Welcome to ZOJ
Information
Select Problem
Runs
Ranklist
ZOJ Problem Set - 2623
Area

Time Limit: 2 Seconds      Memory Limit: 65536 KB

Calculate the total area of two polygons.

Input

There are multiple test cases. Each case begins with two integers N, M (3 <= N, M <= 50), the number of vertex s of two polygons. In the following N + M lines, each contains a pair of real numbers, which describes the coordinates of the vertexes, (xi, yi). The vertex starts from the first vertex to the second one, then from the second to the third, ... and so on.

Output

Output the area one line percase (accurate to three fractional digits).

Sample Input

3 3
0 0
0 1
1 0
0 0
1 0
1 1

Sample Output

0.750



Author: LIU, Yaoting
Source: ZOJ Monthly, November 2005
Submit    Status