#P8608. [蓝桥杯 2013 国 B] 农场阳光

[蓝桥杯 2013 国 B] 农场阳光

Problem Description

Planet X is very special: its rotation speed is the same as its revolution speed, so sunlight always shines at a fixed angle.

Recently, to develop interstellar tourism, Planet X rents out positions in space to tourists from Country Y for sunbathing. Each rented spot is a disk-shaped colored cloud floating in the air (the disk is parallel to the ground). Of course, this will block part of the sunlight, and plants on the blocked land cannot grow.

The task of this problem is to compute how large the area of land on a certain farm is that is suitable for growing crops.

Input Format

The first line of the input contains two integers a,ba,b, representing the length and width of a farm as aa and bb. The farm area is the rectangular region enclosed by the coordinates (0,0,0),(a,0,0),(a,b,0),(0,b,0)(0,0,0),(a,0,0),(a,b,0),(0,b,0).

The second line contains a real number gg, representing the angle of sunlight. For simplicity, we assume the sunlight rays are perpendicular to the farm’s width, and the angle between them and the farm’s length is gg degrees. Then, the projection of a point (x,y,z)(x,y,z) in space onto the ground should be (x+z×ctg(g),y,0)(x+z \times \ctg(g),y,0), where ctg(g)\ctg(g) denotes the cotangent value corresponding to gg degrees.

The third line contains a non-negative integer nn, representing the number of rented spots in the air.

The next nn lines describe each rented spot. The ii-th line contains 44 integers xi,yi,zi,rix_i,y_i,z_i,r_i, indicating that the center of the ii-th colored cloud is at (xi,yi,zi)(x_i,y_i,z_i) and its radius is rir_i.

Output Format

Output a real number, rounded to two decimal places, representing the area of land on the farm where crops can grow.

10 10
90.0
1
5 5 10 5
21.46
8 8
90.0
1
4 4 10 5
1.81

20 10
45.0
2
5 0 5 5
8 6 14 6
130.15

Hint

Time limit: 1 second, 64M. The 4th Lanqiao Cup National Contest in 2013.

Translated by ChatGPT 5