eolymp
bolt
Try our new interface for solving problems
Problems

Children matches are not toys! - 2

Children matches are not toys! - 2

Time limit 1 second
Memory limit 64 MiB

On the table are N matches. They play two, take turns. In one move, the player can take no more than M matches, but not less than one. Climbing the last match wins.

As you already know, with the right game, the chances of winning (in general), the first player a lot more than the second. So Vasya agreed with Masha, Masha, that will always go first, and Vasya will call the maximum number of matches for the collection of M. What is the smallest number N of Masha must choose to secure your winnings no matter how many M to K call Vasya? Under the existing agreement between them, said Masha number should be at least 2 times more than what has been said Vasya.

Input data

The first line is the number of T - the number of test cases. In the following lines of T is the number of K - capture allowed to select a maximum of M in one turn.

1T1000, K2·10^9.

Output data

For each test case in a single line display the appropriate value of N. It is guaranteed that the number of test cases in a single test does not exceed 1000.

Examples

Input example #1
2
3
4
Output example #1
7
11