Limits 500ms, 512 MB

It's Term Break. Hurray !! Muttaqueen is on a tour with his friends at the peak of Keokradong. Adda, songs, guitar, barbeque all seem so magical. He looks up. The night sky is shining with its brightest stars. But as he is still a competitive programmer in heart, an interesting problem pops up in his mind.

The night sky can be represented as a 2D plane. There are N stars in the sky. A star can be considered as a point. For some magical reason, no three stars are collinear. Muttaqueen wonders in how many ways can he choose three stars such that the triangle formed by these stars doesn't contain any other star inside it.

You are his friend. You notice that Muttaqueen is somewhat absent minded looking up the sky. You ask him the reason and he tells you about the problem. Can you solve it quickly for him so you guys can go back to partying ?

Input

The first line contains a single integer the number of testcases t. (1 ≤ t ≤ 100)
The first line of each case contains N, the number of stars you can see in the sky (1 ≤ N ≤ 100).
For next N lines, i'th line contains two integers x, y denoting the co-ordinate of the i'th star. (-1000 ≤ x,y ≤ 1000).
It is guaranteed that no three stars are collinear.

Output

For each case, output a single integer the number of ways of choosing three stars so that no other star is inside the triangle formed by the stars.

Sample

InputOutput
2
6
1 4
0 0
4 5
3 1
-2 2
1 2
3
0 0
10 0
0 10
15
1

Submit

Login to submit.

Statistics

0% Solution Ratio
Toph uses cookies. By continuing you agree to our Cookie Policy.