Antipodal Points Codechef Solution | APRIL CHALLENGE


Antipodal Points Codechef Solution

You are given a set of NN distinct points P1,P2,P3,…,PNP1,P2,P3,…,PN on a 22-D plane.

A triplet (i,j,k)(i,j,k) is called a holy triplet if

  • 1≤i<j<k≤N1≤i<j<k≤N
  • PiPi, PjPj and PkPk are non-collinear and
  • Any two of the points PiPi, PjPj and PkPk 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.

Input Format

  • The first line contains a single integer TT – the number of test cases. Then the test cases follow.
  • The first line of each test case contains an integer NN – the number of points.
  • Each of the next NN lines contains two space separated integers xixi and yiyi, denoting the co-ordinates of ii-th point PiPi.

Output Format

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


  • 1≤T≤101≤T≤10
  • 3≤N≤20003≤N≤2000
  • Sum of NN over all test cases does not exceed 20002000
  • −109≤xi,yi≤109−109≤xi,yi≤109
  • All points P1,P2,…,PNP1,P2,…,PN in each test case are distinct.

Sample Input 1 

0 1
0 -1
1 0
-1 0

Sample Output 1 



Test case 1: The holy triplets in this case areHoly Triplet(1,2,3)(1,2,4)(1,3,4)(2,3,4)1≤i<j<k≤N✓✓✓✓Non collinear✓✓✓✓Antipodal points1 and 21 and 23 and 43 and 4

Antipodal Points Codechef  SOLUTION

Download Code
login to google play console, youtube video search by image, how to add a google account, which are the google apps, what is the google app, how to add a new google account, all the google apps, which service is the part of google, adsetting google, google data studio, google DNS, GCP console, bigquery, google studio, google api console, google app engine, anthos, google apis, google public DNS, google audio, google launcher, gcloud console, google compute engine, google webmaster console, google logged-in devices, gdrive unlimited,google console tools,google studio login,my google voice,hey google service,find similar images google, my google forms, www google com bd search, search using images in google,google image search scan,google sea console,website console google, google sound, gdrive storage for students, google site console, google console login, webmaster console, searc h console, google server down, google backup login, photo finder google, google products and services, google console tool, google image check, google cloud search is used for, google dashboard studio, google voice and audio activity,gcp dashboards, google services down, google go app, google dns down, google image identifier,check picture on google,google new launcher,google image finder online,image check google google google go, image finder on google, finding images on google, photo find google, find a picture in google, find the photo on google, picture find google, image find on google, find with photo google, image finder google online, google find with image, photo finder in google, google find image search, search using image in google, search on google with image, google server down today, google server down news

Read More Post Here

Leave a Comment

Your email address will not be published. Required fields are marked *