#Lutece1257. area2

area2

Migrated from Lutece 1257 area2

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

给出两个多边形,每个多边形按照顺时针或者逆时针顺序给出,求两个多边形相交的面积。

Input

第一行为两个个整数NN,MM(1N,M5001 \leq N, M \leq 500)
接下来第N行每行两个整数xix_i,yiy_i,表示第一个多边形第ii个点的坐标
接下来第M行每行两个整数xix_i,yiy_i,表示第二个多边形第ii个点的坐标

Output

两个多边形相交的面积,保留2位小数

Samples

4 4
0 0
0 1
1 1
1 0
0.5 0.5
0.5 1.5
1.5 1.5
1.5 0.5
1.75

Resources

xwind