program Hunter;

{$APPTYPE CONSOLE}

uses
  SysUtils, Math;

var
  tests, test, n, i, j, x, y, res: integer;
  ks: array [1..100] of real;
  chart: array [1..100] of integer;
  eq: array [1..100] of integer;
   f1:text;
begin
Assign(f1, 'HUNTER.IN');
reset(f1);
readln(f1,tests);
for test := 1 to tests do begin
  readln(f1,n);
  for i := 1 to n do begin
    readln(f1,x, y);
    if x=0 then ks[i] := 999999.9991999
    else ks[i] := y / x;
    if (y > 0) and (x >= 0) then
      chart[i] := 1;
    if (y >= 0) and (x < 0) then
      chart[i] := 2;
    if (y < 0) and (x <= 0) then
      chart[i] := 3;
    if (y <= 0) and (x > 0) then
      chart[i] := 4;
    eq[i] := 0;
  end;

  for i := 1 to n do begin
    for j := 1 to n do begin
      if (ks[i] = ks[j]) and (chart[i] = chart[j]) then
        inc(eq[i]);
    end;
  end;

  res := 0;
  for i := 1 to n do begin
    res := max(res, eq[i]);
  end;

  writeln(res);
end;




end.
