sunny-and-stumps

Dhoni wants to collect sticks for making them as stumps for the T20 cricket matches. Now he visits a shop to buy some. 
The shopkeeper gave him a data of the available sticks in the form of N equations of lines (A.x + B.y + C = 0) which are laid down in the 2D floor of the shop. As the sticks used for making stumps must all be parallel to each other, 
Dhoni wants to know the size of largest group of distinct (if two sticks coincide, then count them as one) sticks he can buy such that all the sticks in the group are parallel to one another.

INPUT 
The first line of input contains one integers T denoting the number of test cases.
Each test case consists of one integer N denoting number of stumps.
Next N lines contain 3 space-separated integers each denoting coefficients A, B and C respectively.

OUTPUT
For each test case output the size of largest group of parallel sticks in a single line.

CONSTRAINS 
Sum of N over all test case is less than 10^7.
|A|,|B|,|C| ≤ 10^18.
1 ≤ N ≤ 10^6.
A and B can't be zero at the same time.
-All selected sticks must be in parallel but they need not to have the same distance between them.

SAMPLE INPUT
1
5
1 3 0
1 7 6
2 6 2
3 5 1
7 9 4

SAMPLE OUTPUT
2

Explanation

Sticks with eqn. 1.x+3.y+0=0 and 2.x+6.y+2=0 forms the largest group of parallel lines.

Source: hackerearth | Difficulty: MEDIUM


Solutions: