#P1194A. Remove a Progression

Remove a Progression

No submission language available for this problem.

Description

You have a list of numbers from 11 to nn written from left to right on the blackboard.

You perform an algorithm consisting of several steps (steps are 11-indexed). On the ii-th step you wipe the ii-th number (considering only remaining numbers). You wipe the whole number (not one digit).

When there are less than ii numbers remaining, you stop your algorithm.

Now you wonder: what is the value of the xx-th remaining number after the algorithm is stopped?

The first line contains one integer TT (1T1001 \le T \le 100) — the number of queries. The next TT lines contain queries — one per line. All queries are independent.

Each line contains two space-separated integers nn and xx (1x<n1091 \le x < n \le 10^{9}) — 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 xx numbers.

Print TT integers (one per query) — the values of the xx-th number after performing the algorithm for the corresponding queries.

Input

The first line contains one integer TT (1T1001 \le T \le 100) — the number of queries. The next TT lines contain queries — one per line. All queries are independent.

Each line contains two space-separated integers nn and xx (1x<n1091 \le x < n \le 10^{9}) — 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 xx numbers.

Output

Print TT integers (one per query) — the values of the xx-th number after performing the algorithm for the corresponding queries.

Samples

Sample Input 1

3
3 1
4 2
69 6

Sample Output 1

2
4
12