#P11009. [2016杭电多校]Eureka
[2016杭电多校]Eureka
Eureka
Problem Description
Professor Zhang draws points on the plane, which are conveniently labeled by . The -th point is at . Professor Zhang wants to know the number of best sets. As the value could be very large, print it modulo . A set ( contains the label of the points) is called best set if and only if there are at least one best pair in . Two numbers and are called best pair, if for every , , where and .
Input
There are multiple test cases. The first line of input contains an integer , indicating the number of test cases. For each test case: The first line contains an integer -- then number of points. Each of the following lines contains two integers and -- coordinates of the -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