Antipodal Points Solution | CodeChef Problem Solution 2022 | April Long Two
You are given a set of distinct points on a -D plane.
A triplet is called a holy triplet if
- , and are non-collinear and
- Any two of the points , and 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 - the number of test cases. Then the test cases follow.
- The first line of each test case contains an integer - the number of points.
- Each of the next lines contains two space separated integers and , denoting the co-ordinates of -th point .
Output Format
For each test case output a single line denoting the number of holy triplets.
Constraints
- Sum of over all test cases does not exceed
- All points 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 :
No comments:
Post a Comment