Authors: Adrian Satja Kurdija, Marin Tomić You are given N lines, their equations being $A_{i}$ $x + B_{i}y + C_{i}= 0$ in the coordinate plane. Calculate the number of triangles whose sides lie on the given lines. Since the result can be very large, output the number modulo 1 000 000 007. Important note: No three lines will intersect at the same point.
Input
The first line of input contains the integer N ($1 \le N \le 300,000$), the number of lines. Each of the following N lines contains three integers: $A_{i}$, $B_{i}$ and $C_{i}$, the numbers defining the $i^{th}$ line. All numbers will be lesser than $10^{9}$.
Output
The first and only line of output must consist of the required number from the task. A possible position of lines. $5^{th}$ round, February $15^{th}$, 2014 Authors: Adrian Satja Kurdija, Marin Tomić
Constraints
In test cases worth 40% of total points, N will be lesser than 1000.
Example 1
6 0 1 0 -5 3 0 -5 -2 25 0 1 -3 0 1 -2 -4 -5 29
10
Example 2
5 -5 3 0 -5 -3 -30 0 1 0 3 7 35 1 -2 -1
10
Clarification of the first example: The example corresponds to the image in the task.
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.