406470: GYM102419 C Two operations

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Two operationstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

You are given an integer $$$n$$$, and you have initially two integers $$$a$$$ and $$$x$$$, $$$a = 1$$$, $$$x=0$$$.

You need to find the minimum number of operations in order to make the value of $$$x$$$ equal to the value of $$$n$$$.

In one operation you can do one of these operations:

1- Increase the value of $$$x$$$ by $$$a$$$, $$$x=x+a$$$.

2- Change the value of $$$a$$$ into $$$x$$$, then increase the value of $$$x$$$ by $$$a$$$, $$$a=x$$$, $$$x=x+a$$$.

Can you find the answer?

Input

The first line of input contains one integer $$$t$$$ $$$(1 \leq t \leq 50)$$$

For each of the next $$$t$$$ lines, the input will contain one integer $$$n$$$ $$$(1 \leq n \leq 10^{9})$$$.

Output

For each test case print it's answer on a line.

ExampleInput
4
1
2
3
4
Output
1
2
3
3

Source/Category

加入题单

上一题 下一题 算法标签: