409873: GYM103821 E Robovac
Description
Edrisov likes to keep his house clean, but knowing that the exams are around the corner, he doesn't have a lot of free time, so he decided it's time to buy a robovac!
Robovac is a short name for robot vaccum cleaner, which -given it's name- does the cleaning automatically.
Edrisov lives inside a line divided into $$$N$$$ cells. Initially the robot is standing on the middle cell (cell with index $$$\lceil \frac {N}{2} \rceil$$$) and faces the right direction (direction of the $$$N_{th}$$$ cell), the robot will keep moving in some direction until it steps on a cell it hasn't visited yet, then it will change direction and repeat the process.
The robot will stop moving when all cells are visited. (see notes for a better understanding on how the robot is moving).
Can you help Edrisov to know how many steps the robot will make during the cleaning process?
InputEach test contains multiple test cases. The first line contains the number of test cases $$$T$$$ ($$$1 \le T \le 10^5$$$). Description of the test cases follows.
Each of the following $$$T$$$ lines, contains a single integer $$$N$$$ ($$$1\le{N}\le{10}^9$$$) — Number of cells in the line.
OutputFor each test case, output a single integer denoting the answer for the $$$i_{th}$$$ test case.
ExampleInput2 3 4Output
3 6Note
for $$$N=4$$$, the robot starts at cell with index $$$2$$$ and faces the right direction:
- in the first step it will visit the $$$3_{rd}$$$ cell, which has not been visited before so the robot will change direction to the left.
- in the second step the robot will revisit the $$$2_{nd}$$$ cell, so it will keep moving to the left.
- in the third step the robot will visit the first cell which hasn't been visited yet, so the robot will change direction to the right.
- the robot will keep moving to the right and stops moving when it reaches the $$$4_{th}$$$ cell, hence the the answer is 6 steps.