var
 i,n,q,j:integer;
 k:longint;
begin
 assign(input,'STAIRS.IN'); reset(input);
 read(q);
 for j:=1 to q do begin
 read(n);
  k:=0;
 for i:=1 to n+1 do begin
  k:=k+i;
 if k>n then begin
  writeln(i-1); break;
 end; end;
 end;
 end.
