PROGRAMMING:Pinch Pinch Pinch
To tell the whole truth, creating a great number of programming problems is a huge project, Little Gyro was quite manic because of it, with the time flying quickly till midnight.
In order to calm down and keep the efficiency, Little Gyro bought some magical instant noodles for himself to eat at that time. Before eating the noodles, Little Gyro decided to pinch these noodles to pieces and enjoyed the pleasure of the sound.
Because of the magical composition of these noodles, In each step, Little Gyro can only take one piece of instant noodles, which would be divided into $$k$$ pieces consisting of $$a_ 1>a_ 2>...>a_ k>0$$, if satisfies the equation $$a_ 1-a_ 2=a_ 2-a_ 3=...=a_{ k-1}-a_ k=1$$. Otherwise, Little Gyro can't split it into pieces anymore. In addition, the number of pieces $$k$$ can be an arbitrary number, but should be no less than $$2$$ naturally.
Given a big piece of magical instant noodles of $$N$$-size, for each step, Little Gyro would make it into pieces as small as he can, until he can't take it apart anymore, because he was very mad and crazy. Now you are asked to tell the maximum number of times he can pinch for.
### Input Specification:
There are multiple test cases. The first line of the input contains an integer $$T$$ (1 ≤ $$T$$ ≤ 1000), indicating the number of test cases. For each test case:
Each line contains a single integer $$N$$ (0 ≤ $$N$$ ≤ $$10^6$$), indicating the size of the magical instant noodles.
### Output Specification:
For each test case, output the maximum operation step of splitting the magical instant noodles.
### Sample Input:
```in
three
one
three
ten
```
### Sample Output:
```out
0
one
two
```
answer:If there is no answer, please comment
It can be inferred from the meaning that a fragment n can be decomposed again if there is an I (I means to divide fragment n into I blocks) satisfying I (I + 1) / 2 + I × Base = = n, the size of fragments after decomposition is base + 1, base + 2,..., base + I. query the decomposition times of these fragments in turn, return the cumulative sum plus this decomposition (1), divide the size of each time by at least 2, consider using DFS, and record the value of each query to avoid repeated queries. Since it is said in the title that each time it is decomposed into as many blocks as possible, I start from the upper bound sqrt (2n + 1) + 1 to confirm whether it can be decomposed.
In order to calm down and keep the efficiency, Little Gyro bought some magical instant noodles for himself to eat at that time. Before eating the noodles, Little Gyro decided to pinch these noodles to pieces and enjoyed the pleasure of the sound.
Because of the magical composition of these noodles, In each step, Little Gyro can only take one piece of instant noodles, which would be divided into $$k$$ pieces consisting of $$a_ 1>a_ 2>...>a_ k>0$$, if satisfies the equation $$a_ 1-a_ 2=a_ 2-a_ 3=...=a_{ k-1}-a_ k=1$$. Otherwise, Little Gyro can't split it into pieces anymore. In addition, the number of pieces $$k$$ can be an arbitrary number, but should be no less than $$2$$ naturally.
Given a big piece of magical instant noodles of $$N$$-size, for each step, Little Gyro would make it into pieces as small as he can, until he can't take it apart anymore, because he was very mad and crazy. Now you are asked to tell the maximum number of times he can pinch for.
### Input Specification:
There are multiple test cases. The first line of the input contains an integer $$T$$ (1 ≤ $$T$$ ≤ 1000), indicating the number of test cases. For each test case:
Each line contains a single integer $$N$$ (0 ≤ $$N$$ ≤ $$10^6$$), indicating the size of the magical instant noodles.
### Output Specification:
For each test case, output the maximum operation step of splitting the magical instant noodles.
### Sample Input:
```in
three
one
three
ten
```
### Sample Output:
```out
0
one
two
```
answer:If there is no answer, please comment
It can be inferred from the meaning that a fragment n can be decomposed again if there is an I (I means to divide fragment n into I blocks) satisfying I (I + 1) / 2 + I × Base = = n, the size of fragments after decomposition is base + 1, base + 2,..., base + I. query the decomposition times of these fragments in turn, return the cumulative sum plus this decomposition (1), divide the size of each time by at least 2, consider using DFS, and record the value of each query to avoid repeated queries. Since it is said in the title that each time it is decomposed into as many blocks as possible, I start from the upper bound sqrt (2n + 1) + 1 to confirm whether it can be decomposed.