program STAIRS;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
 f:text;
 d,i,k,s,kol:integer;
begin
 assign(f,'STAIRS.IN');
 reset(f);
 readln(f,k);
 for i:=1 to k do begin
   readln(f,kol);
   d:=1;
   s:=0;
  while s<=kol do begin
   s:=s+d;
   d:=d+1;
  end;
  writeln(d-2);
 end;
 close(f);
end.
 