22159_Area

2022-5-16 18:21| 发布者: Hocassian| 查看: 26| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506161525199-Problem List-采集的数据-后羿采集器.html

Pro.ID

22159

Title

Area

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22159

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    One day, Nadia got a map about a mysterious continent. This continent consists of some countries. Each country's boundary is a simple polygon. Figure 1 is an example.

    Figure 1 An example of a continent

    Your job is to calculate the area of each country.

    输入

    The first line of each case contains one integer M ( 1 ≤ M ≤ 1000 ). Then M lines follow, each one contains four integers x1, y1, x2, y1, which represent two points of a line segment.

    NOTE: Every finite region is a different country. By a finite region we mean a simple polygon bounded by the given line segments, with no points belonging to any of the given line segments in its interior. The graph represented by all line segments is connected. Each line segment belongs to one or two country. Line segments only intersect at their endpoints.

    Input ends with EOF.

    输出

    Description

    One day, Nadia got a map about a mysterious continent. This continent consists of some countries. Each country's boundary is a simple polygon. Figure 1 is an example.

    Figure 1 An example of a continent

    Your job is to calculate the area of each country.

    Input

    The first line of each case contains one integer M ( 1 ≤ M ≤ 1000 ). Then M lines follow, each one contains four integers x1, y1, x2, y1, which represent two points of a line segment.

    NOTE: Every finite region is a different country. By a finite region we mean a simple polygon bounded by the given line segments, with no points belonging to any of the given line segments in its interior. The graph represented by all line segments is connected. Each line segment belongs to one or two country. Line segments only intersect at their endpoints.

    Input ends with EOF.

    Output

    Output the areas in ascending order. For each country, output the area in one line. Round the numbers in the output to 2 digits after decimal point.

    After each case, output a blank line.

    Sample Input

    9
    1 1 4 1
    1 1 3 6
    5 8 3 6
    3 6 4 1
    5 4 7 2
    3 6 7 6
    5 4 7 6
    7 6 5 8
    4 1 7 2

    6
    1 1 0 2
    0 0 1 1
    2 2 2 0
    1 1 2 2
    0 0 0 2
    1 1 2 0

    Sample Output

    4.00
    7.50
    12.00

    1.00
    1.00

    Source

    样例输入

    9
    1 1 4 1
    1 1 3 6
    5 8 3 6
    3 6 4 1
    5 4 7 2
    3 6 7 6
    5 4 7 6
    7 6 5 8
    4 1 7 2

    6
    1 1 0 2
    0 0 1 1
    2 2 2 0
    1 1 2 2
    0 0 0 2
    1 1 2 0

    样例输出

    4.00
    7.50
    12.00

    1.00
    1.00

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部