#abc061c. [abc061_c]Big Array
[abc061_c]Big Array
Problem Statement
There is an empty array. The following operations will be performed to insert integers into the array. In the -th operation , copies of an integer are inserted into the array. Find the -th smallest integer in the array after the operations. For example, the -th smallest integer in the array is .
Constraints
- All input values are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the -th smallest integer in the array after the operations.
Sample Input 1
3 4
1 1
2 2
3 3
Sample Output 1
3
The resulting array is the same as the one in the problem statement.
Sample Input 2
10 500000
1 100000
1 100000
1 100000
1 100000
1 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000
Sample Output 2
1