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

建议使用的浏览器:

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

2124:Crankshaft

题目描述
One company develops a CAD system for crankshaft design. The crankshafts in question are combined of 0 < N <= 100 metal plates. All plates are made of the same alloy and have equal (small) thickness. Each plate has the shape of a polygon with 3 <= Vi <= 200 vertices. All plates in the crankshaft are parallel and firmly connected to each other. They are the only elements of the crankshaft.
Among other features, this CAD system should have a routine for determining the rotation axis of the crankshaft. More precisely, customers sometimes need to find a line, perpendicular to the plane of the crankshaft plates, rotation around which causes minimal vibration of the crankshaft. It is well known that such axis must pass through the mass center of the crankshaft.
The crankshaft design is stored as a set of vertex coordinates for each plate in some Cartesian coordinate system. The plane OXY of the system is parallel to the plates surfaces. All the coordinates are integer, -104 <= Xij , Yij <= 104 , where 1 <= j <= Vi , 1 <= i <= N . The vertices are numbered clockwise (OX axis is directed rightwards, OY axis is directed upwards).
Your program should print the rotation axis coordinates (XR and YR ). The correct answer should be given even for a partially designed crankshaft (consisting of two or more non-connected parts). You should suppose that these parts are firmly connected.
输入解释
The input file consists of integer numbers, delimited by spaces and/or line feeds. The numbers are specified in the following order:
N
V1 X11 Y11 ... X1V1 Y1V1
...
VN XN1 YN1 ... XNVN YNVN
Output
输出解释
The output file should contain two real numbers: XR and YR . These values must be exact to four digits to the right of the decimal point.
输入样例
2
4 -1 -1 -1 1 1 1 1 -1
4 -1 -1 -1 0 0 0 0 -1
输出样例
-0.1000 -0.1000

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

源链接: POJ-2124

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

共提交 0

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