Central Lake

아직 제출이 없습니다시간 제한3초메모리 제한512 MB

문제

The town where Jaehyun lives is a circle with a radius of RR. There are 360,000360\\,000 points on the circumference, numbered in counterclockwise order: if you go counterclockwise from point 359,999359\\,999, the next point is point 00. All the distances between pairs of neighboring points are equal.

Initially, there were NN houses in some of the 360,000360\\,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 RR and rr: the radius of the country and the radius of the lake, respectively (10R10510 \le R \le 10^5, 1r<R1 \le r < R).

The second line contains an integer NN (2N100,0002 \le N \le 100\\,000). The third line contains NN space-separated integers a_1,a_2,,a_Na\_{1}, a\_{2}, \ldots, a\_{N}: the locations of NN houses (0a_i<360,0000 \le a\_{i} < 360\\,000, all a_ia\_{i} are pairwise distinct).

The next line contains an integer QQ, the number of queries (1Q100,0001 \le Q \le 100\\,000).

The following QQ lines describe the queries. Each of these lines contains two space-separated integers qq and xx (1q21 \le q \le 2, 0x<360,0000 \le x < 360\\,000).

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

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

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

출력

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