## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## Antipodal Points Solution | CodeChef Problem Solution 2022 | April Long Two

You are given a set of $N$ distinct points ${P}_{1},{P}_{2},{P}_{3},\dots ,{P}_{N}$ on a $2$-D plane.

A triplet $\left(i,j,k\right)$ is called a holy triplet if

• $1\le i
• ${P}_{i}$${P}_{j}$ and ${P}_{k}$ are non-collinear and
• Any two of the points ${P}_{i}$${P}_{j}$ and ${P}_{k}$ are antipodal points of the circle that passes through all three of them.

Two points on a circle are said to be antipodal points of the circle if they are diametrically opposite to each other.

Find the total number of holy triplets.

Solution Click Below:-

### Input Format

• The first line contains a single integer $T$ - the number of test cases. Then the test cases follow.
• The first line of each test case contains an integer $N$ - the number of points.
• Each of the next $N$ lines contains two space separated integers ${x}_{i}$ and ${y}_{i}$, denoting the co-ordinates of $i$-th point ${P}_{i}$.

### Output Format

For each test case output a single line denoting the number of holy triplets.

### Constraints

• $1\le T\le 10$
• $3\le N\le 2000$
• Sum of $N$ over all test cases does not exceed $2000$
• $-{10}^{9}\le {x}_{i},{y}_{i}\le {10}^{9}$
• All points ${P}_{1},{P}_{2},\dots ,{P}_{N}$ in each test case are distinct.

### Sample Input 1

1
4
0 1
0 -1
1 0
-1 0


### Sample Output 1

4


### Explanation

Test case 1: The holy triplets in this case are :