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

建议使用的浏览器:

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

3621:Area K

题目描述
You, and a group of other scientists, have recently discovered strange gravity anomalies on the planet Alderaan. Further analysis shows that the gravity anomalies are caused by some asteroids floating in orbit. The strange positioning of the asteroids notwithstanding, all scientists except you had decided that this is not a matter worthy of attention and departed to continue research on other places. On the other hand, you believe with pure heart that this is not merely a random event, and landed on the surface of Alderaan to continue your study.
After doing some scanning, you have recorded the positions of all asteroids on your navigation computer as points in a three-dimensional Cartesian system. Interestingly, the data shown by your scanning system indicates that there is some sort of force field around each asteroid – more precisely, the shape of every asteroid’s force field is a regular hexahedron whose every face is perpendicular to one of the axis of the coordinate system, which further confirmed your belief that there is something serious going on here. To find out the source of all these, you have decided to do a series of research on the planet.
The first research you have decided to conduct is to get the area of surface on the ground covered by exactly K asteroids’ force field. For simplicity, you can view the surface of Alderaan as the plane Z = 0.
输入解释
There are multiple test cases in the input file. Each test case starts with one integer N (1 <= N <= 104), the number of asteroids in orbit. Each of the next N lines consists of four integers X, Y, Z and L (-106<= X, Y <= 106, 0 < Z, L <= 106), describing the position of an asteroid and its edge length of the force field. The asteroid is just at the center of the hexahedron. The last part of each test case consists of one integer K (1 <= K <= N) followed by a blank line, meaning that you need to get the sum of areas on the ground affected by exactly K asteroids’ force fields.
There is a blank line between two successive test cases. A single line with N = 0 indicates the end of input file.
输出解释
For each test case, output one real number on one separate line, the total area of surface covered by exactly K asteroids, in the format as indicated in the sample output.
输入样例
2
1 0 1 2
0 1 1 2
1

0
输出样例
Case 1: 6.000
来自杭电HDUOJ的附加信息
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3621

最后修改于 2020-10-25T23:05:19+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000/3000MS(Java/Others) 32768/32768K(Java/Others)