program Project2;
{$APPTYPE CONSOLE}
uses
  SysUtils;

var
  a: array[1..100] of integer;
  b: array[1..100] of extended;
  s: string;
  x,i: integer;
  f: textfile;
begin
AssignFile(f,'salads.in');
reset(f);
readln(f,s);
x:=strtoint(s);
for i:=1 to x do begin
  readln(f,s);
  a[i]:=strtoint(s);
end;
for i:=1 to x do begin
  if a[i]=2 then b[i]:=1;
  if a[i]=3 then b[i]:=a[i]+1;
  if a[i]=4 then b[i]:=(((a[i]*(a[i]-1))/2)+a[i])+1;
end;
for i:=1 to x do begin
s:=floattostr(b[i]);
writeln(s);
end;
closefile(f);
end.
 