program WEIGHING;

{$APPTYPE CONSOLE}
var
i, t, n:integer;
begin
assign (input, 'WEIGHING.in'); reset (input) ;
 readln(t);
 if (t>=2) and (t<=1000000000) then
 
 for i := 1 to t do begin
 readln(n);
   if (n div 2 = 0) then writeln(n mod 2)   else
   writeln (n div 2);

end;
end.
