2791. Asteroids

单点时限: 1.0 sec

内存限制: 256 MB

Association of Collision Management (ACM) is planning to perform the controlled collision of two asteroids. The asteroids will be slowly brought together and collided at negligible speed. ACM expects asteroids to get attached to each other and form a stable object. Each asteroid has the form of a convex polyhedron. To increase the chances of success of the experiment ACM wants to bring asteroids together in such manner that their centers of mass are as close as possible. To achieve this, ACM operators can rotate the asteroids and move them independently before bringing them together.

Help ACM to find out what minimal distance between centers of mass can be achieved. For the purpose of calculating center of mass both asteroids are considered to have constant density.

输入格式

Input file contains two descriptions of convex polyhedra.

The first line of each description contains integer number — the number of vertices of the polyhedron (). The following lines contain three integer numbers each — the coordinates of the polyhedron vertices (). It is guaranteed that the given points are vertices of a convex polyhedron, in particular no point belongs to the convex hull of other points. Each polyhedron is non-degenerate.

The two given polyhedra have no common points.

输出格式

Output one floating point number — the minimal distance between centers of mass of the asteroids that can be achieved. Your answer must be accurate up to .

样例

Input
8
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
5
0 0 5
1 0 6
-1 0 6
0 1 6
0 -1 6
Output
0.75

2 人解决,20 人已尝试。

2 份提交通过,共有 49 份提交。

9.9 EMB 奖励。

创建: 9 年,9 月前.

修改: 2 年前.

最后提交: 1 年,9 月前.

来源: Northeastern European Regional Contest 2009

题目标签