#P1426C. Increase and Copy
Increase and Copy
No submission language available for this problem.
Description
Initially, you have the array consisting of one element ().
In one move, you can do one of the following things:
- Increase some (single) element of by (choose some from to the current length of and increase by one);
- Append the copy of some (single) element of to the end of the array (choose some from to the current length of and append to the end of the array).
For example, consider the sequence of five moves:
- You take the first element , append its copy to the end of the array and get .
- You take the first element , increase it by and get .
- You take the second element , append its copy to the end of the array and get .
- You take the first element , append its copy to the end of the array and get .
- You take the fourth element , increase it by and get .
Your task is to find the minimum number of moves required to obtain the array with the sum at least .
You have to answer independent test cases.
The first line of the input contains one integer () — the number of test cases. Then test cases follow.
The only line of the test case contains one integer () — the lower bound on the sum of the array.
For each test case, print the answer: the minimum number of moves required to obtain the array with the sum at least .
Input
The first line of the input contains one integer () — the number of test cases. Then test cases follow.
The only line of the test case contains one integer () — the lower bound on the sum of the array.
Output
For each test case, print the answer: the minimum number of moves required to obtain the array with the sum at least .