Choose three points

You are given n points on the plane, no three of which are colinear.
Therefore, there is always exactly one circle that passes through any
three of the given points. Please choose any three points such that its
corresponding circle encloses the n points.

Input

Input consists of several cases. Every case begins with n, followed by n
different points, no three of which are colinear. The coordinates are
integer numbers less than 10⁵ in absolute value. Assume 3 ≤ n ≤ 5000.

Output

Print one line for every case, with three points such that their
corresponding circle includes all the given points. Print, in any order
and separated by one space, the index of the points (numbered from 1 to
n). If there are several solutions, print any of them. If there is no
solution, print “I hate geometric problems”.

Observations

- If you use C++ floating-point numbers, in order to avoid precission
  issues use the @long double@ type to perform calculations.

- The problemsetter’s solution has cost Θ(n).

Problem information

Author: Salvador Roura

Generation: 2026-01-25T11:47:53.982Z

© Jutge.org, 2006–2026.
https://jutge.org
