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

建议使用的浏览器:

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

2826:An Easy Problem?!

题目描述
It's raining outside. Farmer Johnson's bull Ben wants some rain to water his flowers. Ben nails two wooden boards on the wall of his barn. Shown in the pictures below, the two boards on the wall just look like two segments on the plane, as they have the same width.

Your mission is to calculate how much rain these two boards can collect.
输入解释
The first line contains the number of test cases.
Each test case consists of 8 integers not exceeding 10,000 by absolute value, x1, y1, x2, y2, x3, y3, x4, y4. (x1, y1), (x2, y2) are the endpoints of one board, and (x3, y3), (x4, y4) are the endpoints of the other one.
输出解释
For each test case output a single line containing a real number with precision up to two decimal places - the amount of rain collected.
输入样例
2
0 1 1 0
1 0 2 1

0 1 2 1
1 0 1 2
输出样例
1.00
0.00

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

源链接: POJ-2826

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

共提交 0

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