The problem statement has recently been changed. View the changes.
×
A. Find The Array
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Let's call an array aa consisting of nn positive (greater than 00 ) integers beautiful if the following condition is held for every ii from 11 to nn : either ai=1ai=1 , or at least one of the numbers ai1ai1 and ai2ai2 exists in the array as well.

For example:

  • the array [5,3,1][5,3,1] is beautiful: for a1a1 , the number a12=3a12=3 exists in the array; for a2a2 , the number a22=1a22=1 exists in the array; for a3a3 , the condition a3=1a3=1 holds;
  • the array [1,2,2,2,2][1,2,2,2,2] is beautiful: for a1a1 , the condition a1=1a1=1 holds; for every other number aiai , the number ai1=1ai1=1 exists in the array;
  • the array [1,4][1,4] is not beautiful: for a2a2 , neither a22=2a22=2 nor a21=3a21=3 exists in the array, and a21a21 ;
  • the array [2][2] is not beautiful: for a1a1 , neither a11=1a11=1 nor a12=0a12=0 exists in the array, and a11a11 ;
  • the array [2,1,3][2,1,3] is beautiful: for a1a1 , the number a11=1a11=1 exists in the array; for a2a2 , the condition a2=1a2=1 holds; for a3a3 , the number a32=1a32=1 exists in the array.

You are given a positive integer ss . Find the minimum possible size of a beautiful array with the sum of elements equal to ss .

Input

The first line contains one integer tt (1t50001t5000 ) — the number of test cases.

Then tt lines follow, the ii -th line contains one integer ss (1s50001s5000 ) for the ii -th test case.

Output

Print tt integers, the ii -th integer should be the answer for the ii -th testcase: the minimum possible size of a beautiful array with the sum of elements equal to ss .

Example
Input
Copy
4
1
8
7
42
Output
Copy
1
3
3
7
Note

Consider the example test:

  1. in the first test case, the array [1][1] meets all conditions;
  2. in the second test case, the array [3,4,1][3,4,1] meets all conditions;
  3. in the third test case, the array [1,2,4][1,2,4] meets all conditions;
  4. in the fourth test case, the array [1,4,6,8,10,2,11][1,4,6,8,10,2,11] meets all conditions.