- Time limit: 1.00 s
- Memory limit: 512 MB
Your task is to process $q$ queries of the form: "when there are $n$ children, who is the $k$th child that will be removed?"
The first input line has an integer $q$: the number of queries.
After this, there are $q$ lines that describe the queries. Each line has two integers $n$ and $k$: the number of children and the position of the child.
Print $q$ integers: the answer for each query.
- $1 \le q \le 10^5$
- $1 \le k \le n \le 10^9$