Celtic Symmetry
InterviewTime limit2sMemory limit512 MB
Given up to 1000 distinct integer points in the plane, count the distinct lines of symmetry of the set.
Problem
After a class on ancient Irish history, Diarmuid took an interest in geometric patterns hidden in the locations of neolithic tombs around Ireland. He plots the positions of tombs on the plane, and no two tombs sit at the same point. Count the lines of symmetry of this set of points.
A line of symmetry is a line such that the points on one side are mirror images of the points on the other side. In other words, reflecting every point of the set across the line must give back exactly the same set.
Input
The first line contains the number of tombs ().
Each of the next lines contains two integers and , the coordinates of one tomb, separated by a space (). No coordinate pair is given twice.
Output
Print the number of distinct lines of symmetry of the point set.