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

[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