That’s all: Compute the distance between the sides of two given polygons.
Input consists of several cases. Each case begins with two numbers and . Follow the points that define the first polygon, and the points that define the second polygon. Assume . All the given coordinates are integer numbers with absolute value at most .
For every case, print its number followed by the minimum distance between the sides of the two polygons, rounded to four digits after the decimal point. If handled correctly, the input cases have no precision issues.
Input
3 3 0 0 0 1 1 0 2 2 1 2 2 1 4 2 0 0 6 6 0 6 6 0 3 4 3 5 1 3 8 8 8 7 8 9 8 9 2 2 -1 -1 1 1 -1 1 1 -1 1 1 0 0 0 0 2 2 0 0 0 2 0 1 0 3 1 1 1 1 1 0
Output
Case #1: 1.4142 Case #2: 0.7071 Case #3: 0.0000 Case #4: 0.0000 Case #5: 0.0000 Case #6: 0.0000 Case #7: 1.0000