Pro.ID22159 TitleArea Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22159 AC0 Submit0 Ratio- 时间&空间限制描述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 Sample Output 4.00 Source 样例输入9 样例输出4.00 作者 |