2127: 地图探险(2024)
Memory Limit:512 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:admin
Submit:32
Solved:21
Description

Input

Output

Sample Input Copy
2
1 5 4
1 1 2
....x
5 5 20
1 1 0
.....
.xxx.
.x.x.
..xx.
x....
Sample Output Copy
3
13
HINT



