#P1194A. Remove a Progression
Remove a Progression
No submission language available for this problem.
Description
You have a list of numbers from to written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are -indexed). On the -th step you wipe the -th number (considering only remaining numbers). You wipe the whole number (not one digit).

When there are less than numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the -th remaining number after the algorithm is stopped?
The first line contains one integer () — the number of queries. The next lines contain queries — one per line. All queries are independent.
Each line contains two space-separated integers and () — the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least numbers.
Print integers (one per query) — the values of the -th number after performing the algorithm for the corresponding queries.
Input
The first line contains one integer () — the number of queries. The next lines contain queries — one per line. All queries are independent.
Each line contains two space-separated integers and () — the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least numbers.
Output
Print integers (one per query) — the values of the -th number after performing the algorithm for the corresponding queries.