#P11020. 「LAOI-6」Radiation
「LAOI-6」Radiation
Description
Tom_nik and Uurist are playing a game on an board. Initially the board is empty. First, Uurist places stones on the board, and then Tom_nik will destroy all the stones. However, for one operation, Tom_nik can only destroy stones that share a row or column.
Uurist will destroy the stones using the minimum number of operations. However, Tom_nik wants to maximize the number of operations Uurist will take by placing the stone in a proper way. You need to give him a specific placement such that Tom_nik's goal will be achieved.
Note that Uurist has to destroy all of the stones.
Input Format
This task contains multiple testcases. For each test, the first line of the input contains an integer , indicating the number of testcases.
Then lines follow, each line containing three integers .
Output Format
For each test case, output lines containing characters, indicating your answer: the character on the -th line and -th column should be "" (withut quotes), if you think you should place a stone on this grid; otherwise it should be "" (without quotes).
You should guarantee that the number of grids with on it is . If there are multiple answers, print any.
2
3 5 2
5 4 7
S....
....S
.....
S..S
...S
S.S.
...S
.S..
Hint
Subtasks are used in this problem.
Subtask 1 ( points): it is guaranteed that .
Subtask 2 ( points): it is guaranteed that .
Subtask 3 ( points): it is guaranteed that .
Subtask 4 ( points): it is guaranteed that , .
Subtask 5 ( points): No special constraint.
For all tests, it is guaranteed that , , , the sum of over all test cases does not exceed .
京公网安备 11011102002149号