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

建议使用的浏览器:

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

6520:Silly Keke

Special Judge 特殊评判
题目描述
Keke encountered another problem. The teacher gave her a part formed by the intersection of several prisms and asked her to find the volume of the part. But her brain doesn't work that she can't finish the work even in very simple cases. Therefore, she urgently needs your help.

To simplify the problem, the part is formed by the intersection of two infinitely long convex right prisms A and B. All joining edges of A are parallel to the $z$-axis, and all joining edges of B are parallel to the $x$-axis. If A and B do not intersect, Keke's teacher thinks that the part has a volume of 0.

Now Keke wants you to help her find the volume of the part.
输入解释
There are mutiple test cases, the number of which is no more than 10. For each test case:

The first line of input contains two integers $n$ and $m$ $(3\leq n, m\leq10^5)$, which represent the number of vertices of the base polygon of A and B respectively.

Following input $n$ lines, each line has $2$ real numbers, representing the vertex coordinates $(x, y) (-100\leq x, y\leq100)$ of the base polygon of A.

Following input $m$ lines, each line has $2$ real numbers, representing the vertex coordinates $(y, z) (-100\leq y, z\leq100)$ of the base polygon of B.

The input guarantees that the vertices of each polygon are given in clockwise or counterclockwise order. Numbers in the same line are separated by spaces. For more detailed input information, please see the sample.
输出解释
For each test case:

The first line of output should contain a non-negative real number, representing the volume of the part, accurate at least to 0.001.
输入样例
4 3
10 0
0 10
-10 0
0 -10
5 0
-15 -10
-15 10
输出样例
1041.666667
提示
Windows gcc don't support long double yet, output with double instead.
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6520

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

共提交 0

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