CVXPOLY - Convex Polygons

You are given n points in the 2-D cartesian coordinate system. You are to determine the number of convex polygons with 3 or more vertices which can be formed by choosing a subset of the given points. To make matters simple, the input obeys the following conditions:

    (1) No 3 points in the input are collinear.

    (2) No 2 points will have the same coordinates.

Since the result can be quite large, you are required to output ( result % 1234567 ) instead.

Input

First line contains an integer T, the number of test cases. In each test case, first line contains n, the number of points in the corresponding test case, next n lines contain 2 space separated integers denoting the coordinate of ith point. Absolute value of the coordinates do not exceed 10000.

Output

T lines each corresponding to the answer of corresponding test case.

Example

Input:
2
4
0 0
2 0
2 2
0 2
6
0 0
2 0
2 2
0 2
1 -1
1 3

Output:
5
42

Constraints

Input Set 1 : numberOfTestCases <= 100, 3 <= n <= 10 timeLimit: 5 seconds 
Input Set 2 : numberOfTestCases <= 50, 3 <= n <= 100 timeLimit: 5 seconds 

Được gửi lên bởi:Race with time
Ngày:2009-02-19
Thời gian chạy:1.913s
Giới hạn mã nguồn:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Ngôn ngữ cho phép:Tất cả ngoại trừ: ERL GOSU JS-RHINO NODEJS PERL6 PYPY RUST SED VB.NET
Nguồn bài:Code Craft 09

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.