|
||||||||||
Furion's SproutTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 165 Accepted Submission(s): 42 Problem Description Furion is the leader of all Night Elves in DOTA. He has a powerful and interesting skill: Szzprout. After he used this skill, several trees will grow quickly to form a square and trap enemy in this square. Now, give you the size of square and map of DOTA, please trap as many enemies as you can. If there are several solutions, show me the topmost one. If there's still a tie, show me the leftmost one. Input The first line contains an integer T indicating the number of test cases, and then follows T cases. The first line of each case contains three integer : X, the size of square, and N, the row number of map, and M, the column number of map. The rest of a case contains N lines, each contains M characters, which '.' indicating an empty grid, and 'x' indicating an grid occupied by an enemy. 0 < T <= 20, 1 < N <= 10, 1 < M <= 10, 1 < x <= min (N, M). Output Print N + 1 lines for each case. In the first line, print the number of trapped enemies Y in this format "Trapped Y enemy(ies).Ħħ Then print a map with N lines and each line contains M characters. In each grip: a) '.' stands for an empty grid; b) 'T' stands for a grid occupied by a tree; c) 'x' stands for a grip occupied by an enemy; d) 'I' stands for a grip occupied by a tree and an enemy meanwhile. Print a blank line after each case. Sample Input
Sample Output
Source | ||||||||||
|