Cocircular Points
Time limit5sMemory limit128 MB
For each test case with up to 100 distinct points, find the largest subset that lies on one common circle and print its size.
- Level
Medium7 of 10
- Topics
- Geometry, Hash map, Combinatorics, Brute force
- Solved
- No attempts yet
Problem
A set of collinear points is a set of points that all lie on a single straight line. Analogously, a set of cocircular points can be defined as a set of points that all lie on a single circle.
Given a set of points, write a program that finds the size of the largest subset of these points that is cocircular (that is, all points of the subset lie on one common circle).
Input
The input consists of several test cases.
The first line of each test case contains the number of points (). Each of the next lines contains the coordinates and of a point (), separated by a space. No two points share the same coordinates.
The last line of the input contains a single , which marks the end of the input.
Output
For each test case, print on its own line the size of the largest subset of the given points that can lie on a single circle.