This page is still under construction.

Parts of this page are still being built. What you see may change.

The Last Samurai

Time limit1sMemory limit512 MB

Summary
Design a board of at most 200 by 200 with rooks, bishops, and knights so the greedy king strategy makes more than 10^6 moves.
Level

Hard9 of 10

Topics
Greedy, Simulation, Implementation
Solved
No attempts yet

Problem

This is an output-only problem.

The chess developers released a new custom mode called "The Last Samurai". On the initial configuration of the board there is one black king and multiple white pieces. The only moving piece is the black king, and the goal is to capture all white pieces without ever putting itself under attack.

Consider a strategy that repeats the following steps:

  1. If there are no white pieces left, black have won.
  2. If there is no way to capture any of the remaining white pieces, black have lost.
  3. Otherwise, consider the shortest sequence of moves that the black king can take to capture a white piece while not placing itself under attack at any point (including immediately after capturing). If there are several different pieces that can be captured in the smallest number of moves, pick one in the topmost possible row; if there is still a tie, pick the leftmost possible piece.
  4. Perform the chosen sequence of moves to capture a piece; repeat from step 1.

You need to design a level with the following properties:

  • The board size is at most 200×200200 \times 200 (that is, no side exceeds 200200).
  • Each white piece is either a rook, a bishop, or a knight.
  • There is exactly one black king on the board, which is initially not under attack from any white piece.
  • The greedy strategy above completes the level, but makes more than 10610^6 moves with the black king.

Please provide any level that satisfies these requirements.

Input

The problem has no input.

Output

The first line prints two space-separated integers nn and mm (1≤n,m≤2001\leq n, m\leq 200), the size of the board. The next nn lines print the level description. The ii-th of them is a string of characters from ".rbnkRBNK", where the jj-th character is:

  • "." if the cell is free,
  • "r" or "R" if the cell is occupied by a white rook,
  • "b" or "B" if the cell is occupied by a white bishop,
  • "n" or "N" if the cell is occupied by a white knight,
  • "k" or "K" if the cell is occupied by the black king.

Hint

The greedy strategy captures all pieces in 10 moves. The king's route is shown below.

Examples1

  1. Example 1

    Input
    Expected output
    8 8
    r.......
    ........
    ........
    ........
    .K......
    .....b..
    ........
    ....n...