program hunter;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n,m,i,t,j,max,a:integer;
x:array[1..100] of integer;
s:array[1..100] of integer;
y:array[1..100] of integer;
k:array[1..100] of real;
begin
assignfile(input,'HUNTER.IN');
reset(input);
readln(t);
for i := 1 to t do begin
readln(n);
for J := 1 to n do
  s[j]:=0;
max:=0;
m:=0;
if n=1 then begin
 writeln('1');
 readln;
end
else
begin
   for j := 1 to n do begin
    read(x[j]);
    readln(y[j]);
   end;
   for j := 1 to n do
   if x[j]=0 then
   m:=m+1
   else
     k[j]:=y[j]/x[j];
   for j := 1 to n do
   for a := 1 to n do
     if k[j]=k[a] then
     s[j]:=s[j]+1;

     max:=s[1];
     for j := 1 to n do
       if s[j]>max then max:=s[j];
       if max>m then
 writeln(max)
 else
 writeln(m);
end;

end;
  close(input);
end.
