#P7676. [COCI 2013/2014 #5] TROKUTI
[COCI 2013/2014 #5] TROKUTI
Description
Given lines in the Cartesian coordinate plane. Points on these lines satisfy .
Please find the number of triangles formed by these lines. Output the answer modulo .
It is guaranteed that no three lines intersect at the same point.
Input Format
The first line contains an integer , indicating the number of lines.
The next lines each contain three integers , meaning that line satisfies the equation.
Output Format
Output one integer: the number of triangles formed by these lines modulo .
6
0 1 0
-5 3 0
-5 -2 25
0 1 -3
0 1 -2
-4 -5 29
10
5
-5 3 0
-5 -3 -30
0 1 0
3 7 35
1 -2 -1
10
Hint
[Sample Explanation #1]

The figure above shows the positions of all lines in the Cartesian coordinate plane, and they form triangles in total.
[Constraints]
For of the testdata, , and .
[Notes]
The scoring of this problem follows the original COCI setting, with a full score of .
This problem is translated from COCI2013_2014 CONTEST #5 *T5 TROKUTI.
Translated by ChatGPT 5
京公网安备 11011102002149号