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

建议使用的浏览器:

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

2150:Crossing Prisms

题目描述
Prof. Bocchan is a mathematician and a sculptor. He likes to create sculptures with mathematics. His style to make sculptures is very unique. He uses two identical prisms. Crossing them at right angles, he makes a polyhedron that is their intersection as a new work. Since he finishes it up with painting, he needs to know the surface area of the polyhedron for estimating the amount of pigment needed.
For example, let us consider the two identical prisms in Figure 14. The definition of their cross section is given in Figure 15. The prisms are put at right angles with each other and their intersection is the polyhedron depicted in Figure 16. An approximate value of its surface area is 194.8255.
Given the shape of the cross section of the two identical prisms, your job is to calculate the surface area of his sculpture.
输入解释
The input consists of multiple datasets, followed by a single line containing only a zero. The first line of each dataset contains an integer n indicating the number of the following lines, each of which contains two integers ai and bi (i = 1, ... , n).
A closed path formed by the given points (a1, b1), (a2, b2), ... , (an, bn), (an+1; bn+1)(= (a1; b1)) indicates the outline of the cross section of the prisms. The closed path is simple, that is, it does not cross nor touch itself. The right-hand side of the line segment from (ai, bi) to (ai+1; bi+1) is the inside of the section.
You may assume that 3 <= n <= 4, 0 <= ai <= 10 and 0 <= bi <= 10 (i = 1, ... , n).
One of the prisms is put along the x-axis so that the outline of its cross section at x = ξ is indicated by points (xi, yi, zi) = (ξ, ai, bi) (0 <= ξ <= 10, i = 1, ... n). The other prism is put along the y-axis so that its cross section at y = η is indicated by points (x, yi, zi) = (ai, η , bi) (0 <= η <= 10, i = 1, ... , n).
输出解释
The output should consist of a series of lines each containing a single decimal fraction. Each number should indicate an approximate value of the surface area of the polyhedron defined by the corresponding dataset. The value must acurate to 4 digits after the decimal point.
输入样例
4
5 0
0 10
7 5
10 5
4
7 5
10 5
5 0
0 10
4
0 10
10 10
10 0
0 0
3
0 0
0 10
10 0
4
0 10
10 5
0 0
9 5
4
5 0
0 10
5 5
10 10
4
0 5
5 10
10 5
5 0
4
7 1
4 1
0 1
9 5
0
输出样例
194.8255
194.8255
600.0000
341.4214
42.9519
182.5141
282.8427
149.2470

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

题目来源 Japan 2004

源链接: POJ-2150

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

共提交 0

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