| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 35 | 23 | 18 | 72.000% |
After having your field picked apart by crows time and time again, you’ve decided to employ a system of scarecrows. In order to determine how effective your scarecrow network is, and which areas need more protection, create a graph to display which areas of the field are protected. Each of your scarecrows has a unique range in which it works. Any location within P distance from a scarecrow with a range of P will be protected.
The first line will contain a single integer n that indicates the number of data sets that follow. Each data set will start with a single integer w, h, and q, denoting the width and height of your field, and the number of scarecrows you have. the next q lines consist of 3 space separated integers, r, c, and p, representing the horizontal and vertical position of each scarecrow and its range. 0≤r
For each test case, output h lines of w characters each, where character w of line h is an ‘*’ if point (w,h) is protected, an ‘x’ if it is a scarecrow, and a ‘.’ Otherwise. Leave a blank line between test cases.
2 5 5 1 2 2 2 5 5 2 1 1 1 3 3 1
..*.. .***. **x** .***. ..*.. .*... *x*.. .*.*. ..*x* ...*.