eolymp
bolt
Try our new interface for solving problems
Problems

Circles

Circles

\textbf{n} different circles are given on the plane. Two circles intersect if they have at least one point in common. Write a program that by the coordinates of the centers of the circles and their radii finds a pair of intersecting circles. \InputFile The first line contains one integer \textbf{n }(\textbf{1 }≤ \textbf{n }≤ \textbf{10 000}). Each of the next \textbf{n} lines contains three positive integers \textbf{x}, \textbf{y}, \textbf{r} less than \textbf{10 000}, which specify the coordinates of the circle center (\textbf{x}, \textbf{y}) and its radius \textbf{r}. \OutputFile Print the pair of numbers of intersecting circles, or the number \textbf{0} if no two circles intersect. The circles are numbered according to the order in the input file, starting from \textbf{1} to \textbf{n}. If there are several pairs of intersecting circles, print any of them. The elements of the pair can be printed in any order.
Time limit 0.1 seconds
Memory limit 64 MiB
Input example #1
5
5 10 4
6 20 3
10 15 3
12 8 2
13 13 1
Output example #1
5 3
Author Taras Galkovskiy
Source 2009 XXII All-Ukrainian Informatics Olympiad, Khmelnytskiy, March 22 - 27, Round 2