题目 1082: Tetrahedrons and Spheres

时间限制: 1Sec 内存限制: 128MB 提交: 45 解决: 1

题目描述

There are a tetrahedrons and b spheres in the 3D-splace, you’re asked to calculate the volume occupied by at least one of them (i.e. volume of the union of the objects).

输入

There will be at most 20 test cases. Each case begins with two integers ab, the number of tetrahedrons and the number of spheres (1<=a,b<=5). The next lines each contains 12 integers: x1, y1, z1, x2, y2, z2,x3, y3, z3, x4, y4, z4, the coordinates (xi, yi, zi)(1<=i<=4) of the four vertices  of a tetrahedron. The next blines each contains 4 integers x, y, z, r, the coordinates of the center (x, y, z) and the radius r (r<=3). All the coordinate values are integers with absolute values no more than 5. The input is terminated by a=b=0.

输出

 For each test case, print a single line, the volume occupied by at least one of them, rounded to three decimal points.

 

样例输入
1 1
0 0 4 1 0 4 0 1 4 0 0 5
0 0 0 1
0 0
样例输出
4.356
提示

零基础的同学可以先学习基础,教程见:  C语言教程C++教程编译器教程数据结构教程Python教程单片机教程

视频教学见视频网课

标签  标签反馈

通过率

统 计

 提交 45
 正确 1
 格式错误 0
 答案错误 25
 时间超限 10
 输出超限 3
 运行错误 3
 编译错误 5