Logo
(追記) (追記ここまで)

11487번 - Sunlight 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 256 MB21121280.000%

문제

A core right in Roman tenancy law was the availability of sunlight to everybody, regardless of status. Good sun exposure has a number of health benefits, many of which were known even in those ancient times.

The first act of a Roman city plan reviewer, then, is to survey the proposed structures to measure how well they distribute this precious resource. Given any one avenue of buildings arranged West-to-East, the number of hours for which each building is exposed to sunlight needs to be determined.

For the purpose of simplicity, the number of hours a building is in sunlight is proportional to the fraction of the 180 degrees of sky visible from its top. Thanks in no small part to the marvels of ancient engineering (and also to the strict nutritional regimes of old) you may assume each building is infinitesimally thin.

입력

  • One line containing one integer N (1 ≤ N ≤ 2 × 105): the number of buildings.
  • N further lines each containing two space-separated integers Xi and Hi (1 ≤ X, H ≤ 109), the location and height respectively, in metres, of the ith-most building from the west.

출력

On each of the N lines of output, write one real number to at least 4 decimal places of accuracy: the number of hours for which the peak of the i-th building is bathed in sunlight.

제한

예제 입력 1

4
1 1
2 2
3 2
4 1

예제 출력 1

9.0000
12
12.00000
9.0

예제 입력 2

5
100 50
125 75
150 100
175 125
200 25

예제 출력 2

9.0
9.0
9.0
12.0
6.9357496

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2015 H번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /