Given up to 100000 planar points per test case, decide whether any line reflects the set onto itself.
Medium7GeometryHash mapSortingNo attempts yetTime limit2sMemory limit256 MBGiven a point p and a line L in the plane, the reflection of p across L is the point p′ such that the segment pp′ is perpendicular to L and its midpoint lies on L. If p lies on L, then p′=p.

For a set of points in the plane, an axis of symmetry is a line such that the reflection of every point of the set across that line is again a point of the set. Given a set of points, decide whether at least one axis of symmetry exists.
The first line contains the number of test cases K (1≤K≤10).
The first line of each test case contains the number of points N (1≤N≤100000). Each of the next N lines contains the coordinates X and Y of one point, separated by a single space (−10000≤X,Y≤10000). Each coordinate has at most 6 digits after the decimal point. No two points of one test case have the same location. The sum of N over all test cases is at most 200000.
Because the coordinates are real numbers, the input satisfies the following. If an axis of symmetry exists, the reflection of every point coincides exactly with a point of the set. If no axis of symmetry exists, then for every line L there is at least one point whose reflection across L is farther than 10−6 from every point of the set.
For each test case, print YES on its own line if the set has at least one axis of symmetry, and NO otherwise.