program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var ij, ii,i,j:integer;
v,n,max:longint;
hit,x,y:array[1..101] of integer;

begin
 assign(input,'HUNTER.IN'); reset(input);
 readln(ii);
 for ij := 1 to ii do begin
 readln(n);

 for i := 1 to n do
 readln(x[i],y[i]);

 for i:=1 to n do
 hit[i]:=0;

 for i:=1 to n do
 if (x[i]=0) and (y[i]>0) then
 for j:=1 to n do
 if (y[j]>0) and (x[j]=0) then inc(hit[i]);


 for i:=1 to n do
 if (x[i]=0) and (y[i]<0) then
 for j:=1 to n do
 if (y[j]<0) and (x[j]=0) then inc(hit[i]);

 for i:=1 to n do
 if (y[i]=0) and (x[i]<0) then
 for j:=1 to n do
 if (x[j]<0) and (y[j]=0) then inc(hit[i]);

 for i:=1 to n do
 if (y[i]=0) and (x[i]>0) then
 for j:=1 to n do
 if (x[j]>0) and (y[j]=0) then inc(hit[i]);




 for i:=1 to n do
 for j:=1 to n do      begin
 if  (x[i]>0)and (y[i]>0) and (x[j]>0) and (y[j]>0) and ((x[i]/y[i])=(x[j]/y[j])) then inc(hit[i]);
 if  (x[i]>0)and (y[i]<0) and (x[j]>0) and (y[j]<0) and ((x[i]/y[i])=(x[j]/y[j])) then inc(hit[i]);
 if  (x[i]<0)and (y[i]>0) and (x[j]<0) and (y[j]>0) and ((x[i]/y[i])=(x[j]/y[j])) then inc(hit[i]);
 if  (x[i]<0)and (y[i]<0) and (x[j]<0) and (y[j]<0) and ((x[i]/y[i])=(x[j]/y[j])) then inc(hit[i]);
 end;

 max:=0;

 for i:=1 to  n do
 if hit[i]>max then max:=hit[i];

  writeln(max);
 end;
end.
