#P6737. [BalticOI 2016] 迷宫 (Day2)

    ID: 7512 远端评测题 5000ms 500MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>贪心2016提交答案Special Judge构造BalticOI(波罗的海)

[BalticOI 2016] 迷宫 (Day2)

Problem Description

You see a problem.

Given a maze, there are four types of cells in the maze:

  • . floor, walkable.
  • # wall, not walkable and cannot be passed through.
  • x base.
  • o coin.

Your task is to find the maximum number of coins that can be obtained starting from the base, moving up, down, left, or right, and finally returning to the base.

You want to know: given the maze size is n×mn \times m, and the required answer is kk, whether you can construct such a maze.

Because you created tt such problems, you need to construct tt mazes.

Input Format

The first line contains an integer tt, representing the number of mazes to construct.
The next tt lines each contain three integers n,m,kn, m, k, representing the maze size and the final answer.

Output Format

For each test case, output nn lines, each containing mm characters describing the maze.
There should be a blank line between two mazes.

2
3 3 1
4 7 2
###
#.x
#o#

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

Hint

Data Description and Scoring Policy

This is an output-only problem. Please obtain the input testdata from the attachment.

There is 11 set of input and output files with t=50t=50. The file in your submitted answer package should be maze.out.

We define:

  • The difficulty xx of the maze you obtain as the shortest path length to collect all coins starting from the base.
  • The difficulty dd of the maze obtained by the official solution as the shortest path length to collect all coins starting from the base.

This problem uses a Special Judge. For each constructed maze, you can get a score of

max(0,1003(dx))\max(0,100-3(d-x))

points.

Thanks to the spj provider

https://www.luogu.com.cn/user/60864

Notes

Translated from BalticOI 2016 Day2 B Maze

Translated by ChatGPT 5