National Olympiad in Informatics, China, 2005
Li Zhe really really likes his lemon tree, especially on silent nights. When the sky has a crescent moon gently casting light onto the scenery on earth, he feels the need to sit leisurely under the lemon tree which he had planted with his own hands, pondering the philosophies of life.
Li Zhe is a child who enjoys thinking. When he noticed that the shadow casted by the moonlight hitting the lemon tree is extra clear on the ground, he immediately comes up with a question: how large is the area of the tree's shadow?
Li Zhe knows that it is very difficult to directly measure area. Since he is very familiar with the shape of the lemon tree, he would like to use a geometrical method to calculate it. Thus, he has come up with a simplified method.
Li Zhe has split the entire lemon tree into

Figure 1. Cross-section of the lemon tree

Figure 2. Depiction of moonlight ray angles
To simplify calculations, assume that light rays are parallel to each other, the ground is perfectly level, and the area of the shadow produced by the tree trunk is negligible. Li Zhe obviously knows how to find the answer, but he wishes for you to also try your hands.
Input Specification
Line
Line
Line
Adjacent values on the same line in the input will always be separated
by a single space.
Real values in the input will have between
Output Specification
The output should contain
Sample Input
2 0.7853981633
10.0 10.00 10.00
4.00 5.00
Sample Output
171.97
Constraints
In test cases worth
In test cases worth
In test cases worth
In test cases worth
* Note from translator: Layers
Problem translated to English by .
Comments
What am I missing from my program? Is my angle calculation correct?
Your program handles the angle correctly. You did wrong in the area calculation.
Each (except the last) layer of the tree is truncated cone-shaped. A possible shape of the tree's shadow may look like this:
To solve this problem, you need to find the area of the shaded region, which can be done analytically using the scan-line algorithm or using a numerical integration method like the Simpson's rule. The implementation is left as an exercise for you.
Edit 2021-01-30: additional test cases are added to the problem and numerical solutions no longer pass.
Is the problem accuracy now or am I just completely off?