题号:NC233186
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld
题目描述
Thousands of thousands years ago there was a small kingdom located in the middle of the Pacific Ocean. The territory of the kingdom consists two separated islands. Due to the impact of the ocean current, the shapes of both the islands became convex polygons. The king of the kingdom wanted to establish a bridge to connect the two islands. To minimize the cost, the king asked you, the bishop, to find the minimal distance between the boundaries of the two islands.
输入描述:
The input consists of several test cases.
Each test case begins with two integers
. )
Each of the next
lines contains a pair of coordinates, which describes the position of a vertex in one convex polygon.
Each of the next
lines contains a pair of coordinates, which describes the position of a vertex in the other convex polygon.
A line with
indicates the end of input.
The coordinates are within the range
.
输出描述:
For each test case output the minimal distance.
Your answer is acceptable if its absolute or relative error does not exceed

. Formally speaking, suppose that your output is

and the jury's answer is

, your output is accepted if and only if
%7D%E2%89%A410%5E%7B%E2%88%926%7D)
.
示例1
输入
复制
4 4
0.00 0.00
0.00 1.00
1.00 1.00
1.00 0.00
2.00 0.00
2.00 1.00
3.00 1.00
3.00 0.00
0 0