当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2212:Cavern

题目描述
A large system of caverns was discovered some time ago. PSOS know about it and they promised to make these caverns accessible for tourists. PSOS think it could add some more votes for the Party.

Unfortunatelly, there is a big problem. The members did not notice that the caverns are completely flooded by water. Because PSOS want to be modest and they do not want to break their promises, they started to think about the solution in case they really would win the election. One of the most interesting proposals involved even little submarines. But it seems as the best solution, to exhaust the water out of the cavern. The caverns are very well examined, that means it is exactly known where the water is. PSOS would like to know how much water they have to pump out, so they need a computer program that will be able to determine this.

All the cavern space consists of equal cubes, their size is 1 meter. Obviously, it is possible to exhaust water from a continous space only, e.g. the space consisting of neighbouring cubes. Moreover, only the space running to the top layer of cubes may be exhausted. Two cubes are considered neighbouring if they have one common side, not only the edge.
输入解释
At the first line there is a positive integer N stating the number of assignments to follow. Each assignment begins with three integer numbers X, Y, Z on a single line, separated by spaces. 1 <= X,Y,Z <= 100. All the flooded cubes are inside a box with the size X, Y, and Z meters. All cubes outside this box are filled with rock. After the first line, the description of Z layers follows, starting from the top one. Each layer begins with a line with a single integer number P that denotes the number of flooded cubes in that layer. Then P lines follow, each of them consisting of two integer numbers R and S, 1 <= R <= X, 1 <= S <= Y. These number are coordinates of one flooded cube, given in meters.
输出解释
Output a single line for each assignment. The line must contain the sentence "Je nutne vycerpat X litru vody." (X litres of water must be exhausted). Fill the right ammount of litres of water, instead of X. It should include all the water that is accessible from the top layer of the cavern.
输入样例
2
4 4 5
1
3 3
2
1 2
3 3
4
1 2
2 2
2 3
3 3
2
3 3
1 1
0
3 7 2
1
2 4
5
1 4
2 3
2 4
2 5
3 4
输出样例
Je nutne vycerpat 8000 litru vody.
Je nutne vycerpat 6000 litru vody.

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 CTU FEE Local 1998

源链接: POJ-2212

最后修改于 2020-10-29T06:26:45+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000 65536