Codeforces Round 928 (Div. 4) |
---|
Finished |
Vladislav has $$$n$$$ cards numbered $$$1, 2, \dots, n$$$. He wants to lay them down in a row as follows:
The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 5 \cdot 10^4$$$) — the number of test cases.
The only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \leq k \leq n \leq 10^9$$$) — the number of cards Vlad has, and the position of the card you need to output.
For each test case, output a single integer — the $$$k$$$-th card Vladislav lays down.
117 17 27 37 47 57 67 71 134 1484 191000000000 1000000000
1 3 5 7 2 6 4 1 27 37 536870912
In the first seven test cases, $$$n=7$$$. Vladislav lays down the cards as follows:
Name |
---|