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

19295번 - Central Lake 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB259840.000%

문제

The town where Jaehyun lives is a circle with a radius of $R$. There are 360ドル,000円$ points on the circumference, numbered in counterclockwise order: if you go counterclockwise from point 359ドル,999円,ドル the next point is point 0ドル$. All the distances between pairs of neighboring points are equal.

Initially, there were $N$ houses in some of the 360ドル,000円$ points. Because the entire territory was originally flat, people could always go to each other's house by direct path. However, Sunghyeon, the mayor of the city, ordered to dig a lake in the center of the town to make it look good. The center of the lake and the center of the town is the same point. He also plans to demolish old houses and build new ones.

Jaehyun is worried that it will take a long time to walk between the houses because of the central lake. Your task is to calculate the maximum value of the shortest distance between two houses. Of course, every time the mayor orders to build or demolish a house, you have to recalculate the answer.

입력

The first line of input contains two space-separated integers $R$ and $r$: the radius of the country and the radius of the lake, respectively (10ドル \le R \le 10^5,ドル 1ドル \le r < R$).

The second line contains an integer $N$ (2ドル \le N \le 100,000円$). The third line contains $N$ space-separated integers $a_{1}, a_{2}, \ldots, a_{N}$: the locations of $N$ houses (0ドル \le a_{i} < 360,000円,ドル all $a_{i}$ are pairwise distinct).

The next line contains an integer $Q,ドル the number of queries (1ドル \le Q \le 100,000円$).

The following $Q$ lines describe the queries. Each of these lines contains two space-separated integers $q$ and $x$ (1ドル \le q \le 2,ドル 0ドル \le x < 360,000円$).

Each query has one of following formats depending on its type:

  • "1 $x$": Build new house at point $x$.
  • "2 $x$": Demolish a house at point $x$.

It is guaranteed that there is no house at point $x$ when $q$ is 1 and there is a house at point $x$ when $q$ is 2. Also, it is guaranteed that there will be at least two houses at all times.

출력

Print $Q+1$ lines. On the first line, print the maximum distance between two houses after the lake appears, but before all queries. For the next $Q$ lines, output the required answer after executing each query. Absolute or relative error 10ドル^{-6}$ or better will be tolerated.

제한

예제 입력 1

10 5
2
0 90000
4
1 180000
1 240000
2 0
2 90000

예제 출력 1

14.14213562
22.55649583
22.55649583
19.93850195
10

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2018 > Day 5: Grand Prix of Korea E번

Contest > Open Cup > 2017/2018 Season > Stage 10: Grand Prix of Korea E번

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

출처

대학교 대회

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

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