#P11009. [2016杭电多校]Eureka

[2016杭电多校]Eureka

Eureka

Problem Description

Professor Zhang draws nn points on the plane, which are conveniently labeled by 1,2,...,n1, 2, ..., n. The ii-th point is at (xi,yi)(x_i,y_i). Professor Zhang wants to know the number of best sets. As the value could be very large, print it modulo 109+710^9+7. A set PP (PP contains the label of the points) is called best set if and only if there are at least one best pair in PP. Two numbers uu and vv (u,vP,uv)(u, v \in P, u \ne v) are called best pair, if for every wPw \in P, f(u,v)g(u,v,w)f(u,v) \ge g(u,v,w), where f(u,v)=(xuxv)2+(yuyv)2f(u,v)=\sqrt{(x_u-x_v)^2+(y_u-y_v)^2} and g(u,v,w)=f(u,v)+f(v,w)+f(w,u)2g(u,v,w)=\frac{f(u,v)+f(v,w)+f(w,u)}{2}.

Input

There are multiple test cases. The first line of input contains an integer TT, indicating the number of test cases. For each test case: The first line contains an integer nn (1n1000)(1 \le n \le 1000) -- then number of points. Each of the following nn lines contains two integers xix_i and yiy_i (109xi,yi109)(-10^9 \le x_i, y_i \le 10^9) -- coordinates of the ii-th point.

Output

For each test case, output an integer denoting the answer.

Sample Input

3
3
1 1
1 1
1 1
3
0 0
0 1
1 0
1
0 0

Sample Output

4
3
0

Author

zimpha

Source

2016 Multi-University Training Contest 2