"Bzoj 2618" 2618: [Cqoi2006] convex polygon (semi-planar intersection)

Source: Internet
Author: User
2618: [Cqoi2006] Convex polygon Description counter-clockwise gives the vertex coordinates of n convex polygons, and asks them to cross the area. For example, when n=2, two convex polygons such as:

The area of the intersecting portion is 5.233.

Input

The first line has an integer n, which represents the number of convex polygons, and the following describes each polygon in turn. The first line of the I polygon contains an integer mi, which represents the number of sides of the polygon, the following mi lines are two integers per line, and the coordinates of each vertex are given counterclockwise.

Output

The output file contains only a real number that represents the area of the intersection and retains three decimal places.

Sample Input2
6
-2 0
-1-2
1-2
2 0
1 2
-1 2
4
0-3
1-1
2 2
-1 0Sample Output5.233hint

100% data satisfies: 2<=n<=10,3<=mi<=50, integer in [ -1000,1000] per dimensional coordinate

"Bzoj 2618" 2618: [Cqoi2006] convex polygon (semi-planar intersection)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.