#847
Platinum V
STRAŽA
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Near a military base there is a system of trenches, modeled as line segments on a plane. During nighttime, when most soldiers are fast asleep, three guards stand watch of the trenches. Two guards can see each other if there is a trench (or a row of trenches) along the entire straight line segment between them and there is no third guard on that line segment.

For security reasons, the guards must be placed so that each guard sees the other two. How many ways can they be placed?

입력

The first line contains the integer NN (1N201 \le N \le 20), the number of trenches. Each of the next NN lines contains the description of one trench: four positive integers X1,Y1,X2,Y2X_1, Y_1, X_2, Y_2 (all less than or equal to 10001000), where X1X_1 and Y1Y_1 are coordinates of one end, while X2X_2 and Y2Y_2 are coordinates of the other end of the trench.

Trenches in the input may overlap and share endpoints.

출력

Output the number of ways the guards can be placed on a single line.

예제 입력 1

6
0 0 1 0
0 0 0 1
1 0 1 1
0 1 1 1
0 0 1 1
1 0 0 1

예제 출력 1

8

예제 입력 2

4
5 1 7 1
1 1 5 1
4 0 4 4
7 0 3 4

예제 출력 2

1

예제 입력 3

3
2 2 3 2
3 2 3 3
3 3 2 3

예제 출력 3

0
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Platinum V1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.