staircase-problem

Joy is a short and lazy guy, he uses elevator to reach his flat. But unfortunately elevator is not working today and he became sad. Suddenly God came and made the stairs magical, such that he can jump on it in a magical way. Initially he can take 1 or 2  steps. If he jumps x steps at a time then in the next step he can climb either x or x+1 steps depending on his choice and he must reach exactly on n'th step. Help him find the minimum number of jumps to be made.

INPUT

First line will contain t, total number of test case
Next t lines contains n (total number of steps).

0<t ≤ 100

0<n ≤ 10^5

OUTPUT

Minimum steps to reach the stairs.

SAMPLE INPUT
2
2
3

SAMPLE OUTPUT
1
2

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
t=eval(input())
#print t
for _ in range(0,t):
	n=eval(input())
	if n<=2:
		print(1)
	else:
		ans=1
		f=2
		i=3
		while f<n:
			f+=i
			i+=1
			ans+=1
		print(ans)


t=eval(input())
from math import sqrt
for i in range(0,t):
	n=eval(input())
	ans=1+8*n
	ans=sqrt(ans)
	ans=int(ans)
	ans=ans-1
	ans=ans/2
	print(ans)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
t=eval(input())
while t>0:
	t-=1
	n=eval(input())
	l=1
	while n>l+1:
		n-=(l+1)
		l+=1
	print(l)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
t=eval(input())
while t>0:
	t-=1
	n=eval(input())
	l=1
	while n>l+1:
		n-=(l+1)
		l+=1
	print(l)


for i in range(0,eval(input())):
	n=eval(input())
	step,sum=2,0
	while sum<n:
		sum+=step
#		if(sum<n):
		step+=1
	print(step-2)
		


test_case = eval(input())
while test_case>0:
	test_case-=1
	n = eval(input())
	arr = []
	arr.append(1)
	arr.append(1)
	counter=0
	lookup=2
	if n>3:
		for i in range(2,n):
			if counter==lookup:
				lookup+=1
				counter=0
			arr.append(arr[i-lookup]+1)
			counter+=1
	print(arr[n-1])
	


for i in range(0,eval(input())):
	n=eval(input())
	step,sum=2,0
	while sum<n:
		sum+=step
		if(sum<n):
			step+=1
	print(step-1)
		


import math
t=int(input())
while t>0:
	n=int(input())
	y=pow((((n+1)*8)+1),.5)
	u=int(math.ceil((y-1)/2)-1)
	print(u)
	t=t-1