Suresh is in class 12th. He is very fond of mathematics. He already knows about the general equation of line i.e. ax+by+c=0, where a,b and c are coefficients and x and y are variables. Today, He learned about the parallel lines. The parallel lines are the lines that will never meet at any point. Now he has a set of N lines. There can be many subsets of this set in which all the lines are parallel to each other. Help him to find the length of maximum such subset. Input Format The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows. The first line of each test case contains a single integer N denoting the number of lines. Next N lines contains three space-separated integers a, b and c denoting the coefficients of the ith lines. Constraints 1 ≤ T ≤ 20 1 ≤ N ≤ 105 |a|,|b|,|c| ≤ 109 For a line with coefficients a, b and c either a or b is not zero. Output Format For each test case, output a single line containing the length of maximum subset of parallel lines Sample Input 0 1 5 1 0 0 1 2 3 3 4 5 30 40 0 30 40 50 Sample Output 0 2 Explanation 0 Lines 3*x + 4*y + 5 = 0 and 30*x + 40*y + 0 = 0 form a biggest parallel subset. Note: Maximum subset must contain grp of "distinct" parallel lines. line-(3 4 5) and line-(30 40 50) represent same line. Hence maximum subset is which contains either (3 4 5) & (30 40 0) OR (30 40 50) & (30 40 0) which in both case , the length is 2.
Answers
Answered by
2
Answer:
sry......................(
Similar questions