TROKUTI
시간 제한: 1000ms메모리 제한: 128MB출처: COCI 2013-2014BOJ 9937
문제
You are given N lines, their equations being Aix + Biy + Ci = 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.
A possible position of lines.
Important note: No three lines will intersect at the same point.
입력
The first line of input contains the integer N (1 ≤ N ≤ 300 000), the number of lines.
Each of the following N lines contains three integers: Ai, Bi and Ci, the numbers defining the ith line. All numbers will be lesser than 109.
출력
The first and only line of output must consist of the required number from the task.
힌트
Clarification of the first example: The example corresponds to the image in the task.
예제
예제 1
입력
6 0 1 0 -5 3 0 -5 -2 25 0 1 -3 0 1 -2 -4 -5 29
출력
10
예제 2
입력
5 -5 3 0 -5 -3 -30 0 1 0 3 7 35 1 -2 -1
출력
10
코드를 제출하려면 로그인하세요.