시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 0 | 0 | 0 | 0.000% |
You are walking along home across a bridge one night when you notice the pattern of shadows from the two large lamps at one end of the construction makes an interesting symmetrical pattern on the ground, as the lamps are equally far apart from the sides of the bridge in each direction.
The bridge has pillars running in pairs at irregular sizes and intervals, but always with an identical pillar on the opposite side. You may assume that the parts of the pillars above ground level are infinitesimally thin and that the bridge is infinitely long.
Figure E.1: A visualisation of the second sample input.
How much of the bridge ahead of you is in the shadow of at least one lamp?
The input consists of:
Output the total area in square centimetres that is in shadow from the pillars. Your output must be accurate to an absolute or relative error of at most 10−6.
1 1 1 0 1
5
2 4 2 0 2 3 5
32.7