1083 - Union
Time Limit : 10 Second
Memory Limit : 128 MB
Submission: 389
Solved: 138
- Description
- Given two simple polygons, you are asked to calculate the area of their union.
- Input
- There is a single case:
In the first line: two integers n1 and n2, indicating the number of the vertex of the two polygons(3 <= n1, n2 <= 500).
In the following n1 lines: each line contains two integers xi and yi, the coordinate of the i-th vertex of the first polygon.
In the following n2 lines: each line contains two integers xi and yi, the coordinate of the i-th vertex of the second polygon.
All the vertices are given in the counter-clockwise order.
All the xs and the ys are in the range of [-20000, 20000]. - Output
- A single number: the area of the union with a precision of two numbers after the decimal point.
- sample input
-
4 4 1 0 2 0 2 3 1 3 0 1 3 1 3 2 0 2
- sample output
-
5.00
- hint
- source
- Isun