#P4196. 【模板】半平面交 / [CQOI2006] 凸多边形
【模板】半平面交 / [CQOI2006] 凸多边形
Description
Given convex polygons with vertices listed in counterclockwise order, find the area of their intersection. For example, when , the two convex polygons are shown below:

The area of the intersection is .
Input Format
The first line contains an integer , the number of convex polygons. Each polygon is then described in order. For the -th polygon, the first line contains an integer , the number of edges. The next lines each contain two integers, giving the coordinates of the vertices in counterclockwise order.
Output Format
Output a single real number, the area of the intersection, rounded to three decimal places.
2
6
-2 0
-1 -2
1 -2
2 0
1 2
-1 2
4
0 -3
1 -1
2 2
-1 0
5.233
Hint
Constraints: For of the testdata: , , and each coordinate is an integer in .
Translated by ChatGPT 5
京公网安备 11011102002149号