eolymp
bolt
Try our new interface for solving problems
Problems

False figures

False figures

This problem is a test validator for previous problem. The most dicult part is already tested, you have only to test positioning of circles. Imagine table \{\textbf{a_ij}\} of \textbf{1000} lines and \textbf{1000} coloumns. There are \textbf{Q} queries like: \textbf{i_k j_k r_k}, \textbf{1} ≤ \textbf{k} ≤ \textbf{Q} Each of them de nes region of elements of table \{\textbf{a_ij}\} such, that \textbf{(i-i_k)^2 + (j-j_k)^2} ≤ \textbf{r^2_k}. For convenience this region is called circle with centre in cell (\textbf{i_k}, \textbf{j_k}) and radius \textbf{r_k}. Pair of queries \textbf{k} and \textbf{l} (\textbf{k} < \textbf{l}) is invalid, if circles \textbf{k} and \textbf{l} have common cells and there is circle \textbf{t}: \textbf{k} < \textbf{t}≤ \textbf{l}, that isn't contained in circle \textbf{k}. Circles of di erent queries can match. Determine, if there is at least one invalid pair among queries. \InputFile The rst line has number \textbf{Q}, that is amount of queries. Then \textbf{Q} lines describe queries with \textbf{3} integers in each string \textbf{i_k}, \textbf{j_k}, \textbf{r_k}, which are numbers of line and coloumn of central cell and circle radius. \OutputFile Если есть хотя бы одна невалидная пара запросов, вывести номера этих запросов в произвольном порядке. Если таких пар много, разрешается вывести любую из них. Если невалидных пар нет, вывести "\textbf{Ok}". \textbf{Limits} \textbf{1} ≤ \textbf{Q} ≤ \textbf{10^6} \textbf{1 + r_k} ≤ \textbf{i_k} ≤ \textbf{1000-r_k} \textbf{1 + r_k} ≤ \textbf{j_k} ≤ \textbf{1000-r_k} \textbf{0} ≤ \textbf{r_k} < \textbf{500}
Time limit 5 seconds
Memory limit 256 MiB
Input example #1
6
10 10 5
10 10 4
5 10 0
10 5 0
10 15 0
15 10 0
Output example #1
Ok