uses
  SysUtils;
var
k,n,a,s,i:integer;
begin
assign(input,'stairs.in'); reset(input);
read(n);
for i:=1 to n do
  begin
     read(k);
     a:=1;
     s:=0;
     while a<=k do
      begin
        k:=k-a;
        s:=s+1;
        a:=a+1;
      end;
     writeln(s);
  end;
end.
