| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 (추가 시간 없음) | 1024 MB | 77 | 30 | 27 | 79.412% |
Geometry Refresher:
Given a cake in the shape of simple convex polygon, we would like to cut the cake into two pieces; the single cut (straight line) must go thru two of the polygon vertices. Find the two vertices that will make the two pieces as close (in area) as possible, i.e., the difference in the area for the two pieces is the minimum.
The first input line contains an integer, n (4 ≤ n ≤ 100), indicating the number of vertices in the polygon. This is followed by n input lines. Each of these lines provides the x and y coordinates of a vertex in the polygon (the polygon vertices will be provided in a clockwise order). Assume that all of these input values are integers between 1 and 103, inclusive. Also assume that all the vertices are distinct.
Print the difference (in area) between the largest and smallest pieces, rounded to one decimal point, e.g., 0.74 should be printed as 0.7 and 0.75 should be printed as 0.8.
4 6 4 3 4 4 5 5 5
1.0
5 10 10 8 15 13 16 18 15 16 10
15.0