#P4406. [CQOI2005] 三角形面积并

    ID: 5120 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 显示难度省选/NOI− 上传者: 标签>2005重庆各省省选枚举排序

[CQOI2005] 三角形面积并

Background

Link to the enhanced version.

Problem Description

Given nn triangles, compute the area of their union.

Input Format

The first line contains nn (n100n \leq 100), the number of triangles. Each of the next nn lines contains 66 real numbers x1x_1, y1y_1, x2x_2, y2y_2, x3x_3, y3y_3, representing the coordinates of the triangle's vertices. All coordinates are real numbers not exceeding 10610^6, and the input numbers are given with 11 decimal place.

Output Format

Output the union area uu, to two decimal places.

2
0.0 0.0 2.0 0.0 1.0 1.0
1.0 0.0 3.0 0.0 2.0 1.0
1.75

Hint

Translated by ChatGPT 5