#P6602. 「EZEC-2」数轴
「EZEC-2」数轴
Description
X drew a number line. He will perform operations. In each operation, he first adds marks at position on the number line.
Then he needs to choose a pair , where are integers, , and the number of marks on the interval on the number line is less than or equal to .
For each operation, you need to find the maximum value of among all pairs that satisfy the condition.
Input Format
The first line contains three integers, , , and .
The next lines each contain two integers and .
Output Format
Output lines, where the -th line is the answer after the -th operation.
If there is no valid pair , output -1.
5 4 0
2 1
3 1
0 1
1 1
4 1
1
1
0
0
-1
5 15 1
3 1
8 1
1 1
7 1
14 1
15
11
11
7
6
10 100 10
94 3
22 10
9 4
37 1
21 10
92 5
50 9
68 8
44 4
78 9
100
93
83
77
77
77
68
44
40
26
10 100 3
95 1
13 1
52 1
74 1
40 1
54 1
71 1
68 1
51 3
12 2
100
100
100
94
80
59
56
53
50
39
Hint
[Sample Explanation #2]
After each operation, the chosen pairs are .
[Constraints and Notes]
| Test Point ID | |||
|---|---|---|---|
It is guaranteed that for test points , is generated randomly.
For test points , the time limit is , and for all other test points, the time limit is .
For of the data, , , , , and .
Note: Marks may be added multiple times at the same position on the number line.
optimization is enabled automatically. It is guaranteed that the time and memory limits are both more than twice those of with enabled.
Translated by ChatGPT 5
京公网安备 11011102002149号