시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 0 0 0 0.000%

문제

Little Billy likes drawing with chalks of all colors. As a child of his age, all he can do is to draw straight lines. Today he has been told that hills are of the shape of triangles, and he brought out a lot of his works and tried to identify as many hills as he could. Being one of his best friends, you gladly joined his effort. However after working for a while you are desperate to find the huge number of sketches he has produced. You suggested this alternative plan — to code up a program for him.

Figure 1: The Figure Only Containing One Hill

Keep in mind that in Billy’s pictures all the lines are connected, no line will have an end point right on another line, and there is no single point where more than two lines intersect. We would only count the hills that are not cut by other lines.

입력

The first line of the input is a single integer T which is the number of test cases. T test cases follow, each preceded by a single blank line.

Each test case starts with an integer N (1 < N ≤ 500), which is the number of lines on the picture. The next N lines contain a line segment’s two end points. The coordinates are all integers (−10, 000 < x, y < 10, 000).

출력

For each case, print the number of hills on a single line.

예제 입력 1

3

3
-1 0 3 0
0 -1 0 3
-1 3 3 -1

4
-3 0 3 6
3 0 -3 6
5 3 0 9
1 0 1 9

6
-30 -20 30 -20
-20 -30 -20 30
-30 20 30 20
20 -30 20 30
-30 -10 10 30
-11 11 -9 9

예제 출력 1

1
2
0