You are attempting a test in which there is no punishment for wrong submissions and time constraints. There can be many numbers of participants on the same rank. The candidates who have the same score are on the same rank. The next rank is determined on the basis of the number of candidates who have secured the previous rank.
You are given the last rank and number of candidates who have secured the last rank. For example, if there are five candidates in the contest and their respective scores are 100, 100, 90, 90, and 80. The ranks of these candidates are 1, 1, 3, 3, and 5 respectively. You know 5 and 1 that is the last rank and the number of participants who have secured the last rank. You are required to determine the total number of participants in the contest.
Input format
Output format
For each query, print an integer N denoting the total number of contestants in the contest.
Constraints
1≤Q≤1051≤L≤10121≤C≤1012
Please refer to the problem statement for sample explanation.