program salads;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
 f:text;
 s,i,a,t,p:integer;
begin
 assignfile(f,'salads.in');
 reset(f);
 read(f,t);
 for i:=1 to t do begin
        s:=0;
    readln(f,a);
    p:=1;
    for p:=1 to a do begin
         s:=s+(a-(p+1)+(a-2));
    end;
    writeln(s+1);
    s:=0;
 end;
 closefile(f);

end.
