A1004.Permutation--Gold
省选/NOI-
USACO
通过率:0%
时间限制:1.00s
内存限制:128MB
题目描述
Bessie has N (3≤N≤40) favorite distinct points on a 2D grid, no
three of which are collinear. For each 1≤i≤N, the i-th point is
denoted by two integers xi and yi (0≤xi,yi≤104).
Bessie draws some segments between the points as follows.
- She chooses some permutation p1,p2,…,pN of the N points.
- She draws segments between p1 and p2, p2 and p3, and p3 and p1.
- Then for each integer i from 4 to N in order, she draws a line segment from pi to pj for all j<i such that the segment does not intersect any previously drawn segments (aside from at endpoints).
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 109+7.
输入格式
The first line contains N.
Followed by N lines, each containing two space-separated integers xi and
yi.
输出格式
The number of permutations modulo 109+7.
输入输出样例
输入#1
4 0 0 0 4 1 1 1 2
输出#1
0
说明/提示
No permutations work.