Comments

consider (x1,y1),..,(x4,y4) to be the four coords of a parallelogram in clockwise order ...as the diagonals of a parallelogram bisect each other (x1+x3)/2==(x2+x4)/2 ...same for y coordinates..so if we have n pairs of (x1+x3,y1+y3) ..it would add n*(n-1)/2 to our count