eolymp
bolt
Try our new interface for solving problems
Problems

Children matches are not toys! - 2

Children matches are not toys! - 2

\includegraphics{https://static.e-olymp.com/content/0e/0ef7fe45fa90d7451b3038b57741862c513618f2.jpg} On the table are \textbf{N} matches. They play two, take turns. In one move, the player can take no more than \textbf{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 \textbf{M}. What is the smallest number \textbf{N} of Masha must choose to secure your winnings no matter how many \textbf{M} to \textbf{K} call Vasya? Under the existing agreement between them, said Masha number should be at least \textbf{2} times more than what has been said Vasya. \InputFile The first line is the number of \textbf{T} - the number of test cases. In the following lines of \textbf{T} is the number of \textbf{K} - capture allowed to select a maximum of \textbf{M} in one turn. \textbf{1} ≤ \textbf{T} ≤ \textbf{1000}, \textbf{K} ≤ \textbf{2·10^9}. \OutputFile For each test case in a single line display the appropriate value of \textbf{N}. It is guaranteed that the number of test cases in a single test does not exceed \textbf{1000}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
2
3
4
Output example #1
7
11