시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB2743100.000%

문제

Uolevi has developed a game where the player collects coins in a maze. At the moment, the problem is that the game is too easy. Could you design some challenging mazes for the game?

Each maze is a rectangular grid that consists of floors (.) and walls (#). One of the cells is a base (x), and some cells can contain coins (o). The player begins in the base, and can move left, right, up and down. The task of the player is to collect all coins in the maze and then return to the base.

The difficulty of a maze is the length of the shortest path that begins in the base, collects all coins and returns to the base.

입력

The input begins with an integer t: the number of mazes. After this, t lines follow. Each such line contains three integers n, m and k. This means that the size of the maze must be n × m cells and there must be exactly k coins.

출력

The output should contain t maze descriptions, separated by empty lines, in the same order as in the input. Each maze must be solvable.

예제 입력 1

2
3 3 1
4 7 2

예제 출력 1

###
#.x
#o#

.o.####
.#..x.#
...##.#
###o...

힌트

The difficulty of the first maze is 4, and the difficulty of the second maze is 18.

For each maze, your score is max(0, 100 - 3(d-x)) where x is the difficulty of your maze and d is the difficulty of the most challenging maze found by the jury. Your total score for the task is the average of all scores rounded down to an integer.

This is an output only task and there is only one input file (maze.in). You can download the input file here. You have to submit an output file (maze.out) that contains all the mazes specified in the input file.

채점 및 기타 정보

  • 예제는 채점하지 않는다.