#abc306e. [abc306_e]Best Performances
[abc306_e]Best Performances
Problem Statement
We have a sequence of length . Initially, all the terms are .
Using an integer given in the input, we define a function as follows:
- Let be the sequence obtained by sorting in descending order (so that it becomes monotonically non-increasing).
- Then, let .
We consider applying updates on this sequence.
Apply the following operation on the sequence for in this order, and print the value at that point after each update.
- Change to .
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print lines in total. The -th line should contain the value as an integer when the -th update has ended.
Sample Input 1
4 2 10
1 5
2 1
3 3
4 2
2 10
1 0
4 0
3 1
2 0
3 0
Sample Output 1
5
6
8
8
15
13
13
11
1
0
In this input, and . updates are applied.
- The -st update makes . Now, .
- The -nd update makes . Now, .
- The -rd update makes . Now, .
- The -th update makes . Now, .
- The -th update makes . Now, .
- The -th update makes . Now, .
- The -th update makes . Now, .
- The -th update makes . Now, .
- The -th update makes . Now, .
- The -th update makes . Now, .