Maximize the number of landed stones when jump lengths grow by at least one each time and the last landing is stone N.
Easy3MathBinary searchInterviewNo attempts yetTime limit1sMemory limit256 MBSeungtaek wants to cross a river. He cannot swim, so he crosses by stepping on the stones laid in the water.
He cannot swim, but he is very good at standing jumps, and he can jump straight to any spot he wants.
Seungtaek is standing on one bank. Stones numbered 1, 2, 3, ..., N lie across the river in that order. Call the bank he starts from position 0 and stone i position i, so the length of one jump is the difference between the two positions.
The river is wide, so there are a great many stones. Seungtaek does not want to step on all of them, so he uses his jumping skill and steps on only a suitable number of them.
He is allowed to jump straight to the far bank, but to make the crossing more fun he fixed the following rules.
Find the largest number of stones Seungtaek can step on while following these rules.
The first line contains the number of test cases T (1≤T≤100000).
Each of the next T lines contains one integer N, the total number of stones (1≤N≤1016).
For each test case, print on one line the largest number of stones Seungtaek can step on.