SPC 2019 |
---|
Finished |
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?
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})$$$.
For each test case print it's answer on a line.
4 1 2 3 4
1 2 3 3
Name |
---|