Eureka
Time limit5sMemory limit64 MB
Count the subsets of n labeled points that contain a pair whose segment covers every other chosen point, modulo 1e9+7.
Problem
Professor Zhang draws points on the plane, labeled . The -th point is at . Professor Zhang wants to count the best sets modulo .
A set of point labels is a best set if and only if contains at least one best pair. Two distinct labels and (, ) form a best pair if, for every , , where and .
Input
There are multiple test cases. The first line contains an integer , the number of test cases. Each test case begins with an integer (), the number of points, followed by lines that each contain two integers and (). There are no more than test cases, and the sum of over all test cases is at most .
Output
For each test case, print the number of best sets modulo on its own line.