Giving n
(any amount) of points (x,y)
. What's the minimum amount of circles required to cross every point given?
Task
Your program will get n
(you can have n
as part of input or use EOF instead) points (x,y)
.
The points might at same place => (x1,y1) = (x2,y2)
can happen
x
and y
will be integer of range -10000~10000
, while n
, if you need it, will be integer too.
You should output an integer A
which represent the minimum amount of circle needed to intersect all of the points. Those circle are not required to intersect each other.
Explanation
For example: 1, 2 points will need 1 circle only to be sure that the points touch the circles boundary
but 3, 4 points may need 2 circles, or 1 (Determined by where the points are)
Basic test cases:
(10,10), (0,5), (0,0), (5,10) => 1 circle
(10,10), (5,5), (0,0), (5,10) => 2 circles
(1,1), (2,2), (5,3), (-1,5), (0,0) => 2
(0,0), (1,1), (2,2), (3,3), (4,4), (5,5) => 3
Line are NOT considered as a circle
If there are 3 points (0,0)
(5,5)
(10,10)
. Then the answer would be 2
since those 3 points forms a line if you try to force a circle out of it.
Rules
- Input can be taken in any convenient format.
- Output can be in any convenient format as well. As long as it follow the input-reversed input order.
- Standard Loopholes are forbidden.
Scoring
Golf your way to the shortest code!