| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 512 MB | 89 | 57 | 48 | 62.338% |
Bessie has $N$ (3ドル\le N\le 40$) favorite distinct points on a 2D grid, no three of which are collinear. For each 1ドル\le i\le N,ドル the $i$-th point is denoted by two integers $x_i$ and $y_i$ (0ドル\le x_i,y_i\le 10^4$).
Bessie draws some segments between the points as follows.
Bessie notices that for each $i,ドル she drew exactly three new segments. Compute the number of permutations Bessie could have chosen on step 1 that would satisfy this property, modulo 10ドル^9+7$.
The first line contains $N$.
Followed by $N$ lines, each containing two space-separated integers $x_i$ and $y_i$.
The number of permutations modulo 10ドル^9+7$.
4 0 0 0 4 1 1 1 2
0
No permutations work.
4 0 0 0 4 4 0 1 1
24
All permutations work.
5 0 0 0 4 4 0 1 1 1 2
96
One permutation that satisfies the property is $(0,0),(0,4),(4,0),(1,2),(1,1).$ For this permutation,
Diagram:
The permutation does not satisfy the property if its first four points are $(0,0),ドル $(1,1),ドル $(1,2),ドル and $(0,4)$ in some order.