Problem E
Skyline

In this problem, we assume that all buildings have a trapezoid shape when viewed from a distance. That is, vertical walls but a roof that may slope. Given the coordinates of the buildings, calculate how large part of each building that is visible to you (i.e. not covered by other buildings).
Input
The first line contains an integer,
Output
For each building, output a line containing a floating point
number between
![\includegraphics[width=\linewidth ,height=150pt,keepaspectratio=true]{skyline1}](/problems/skyline/file/statement/en/img-0002.png)
Sample Input 1 | Sample Output 1 |
---|---|
4 2 3 7 5 4 6 9 2 11 4 15 4 13 2 20 2 |
1.00000000 0.38083333 1.00000000 0.71428571 |
Sample Input 2 | Sample Output 2 |
---|---|
5 200 1200 400 700 1200 1400 1700 900 5000 300 7000 900 8200 400 8900 1300 0 1000 10000 800 |
1.00000000 1.00000000 1.00000000 1.00000000 0.73667852 |