program Project2;
{$APPTYPE CONSOLE}
uses
  SysUtils;

var
  a: array[1..100] of integer;
  b: array[1..100] of extended;
  c: array[1..100] of extended;
  x,i: integer;
  s: string;
  f: textfile;
begin
AssignFile(f,'chocolate.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
b[i]:=(a[i]*3)/2;
c[i]:=(b[i]*(b[i]-1))/2;
end;
for i:=1 to x do begin
s:=floattostr(c[i]);
writeln(s);
end;
closefile(f);
end.
