Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/eng-uzoq-nuqta

Farthest point

Easy 1000 ms 64 MB 32%
Share

$n$ points are given on the plane. Find the number of the point farthest from the origin. If there are several such points, take the first one in the list.

Points on the coordinate plane; the point farthest from the origin and the distance segment are highlighted

Input

The first line contains a positive integer $n$.
Each of the next $n$ lines contains two integers: $x_{i}$ and $y_{i}$.

Output

One integer — the number of the point.

Note

$1 \le n \le 10^{4}$
$-10^{6} \le x_{i}, y_{i} \le 10^{6}$

Examples

Input #1
4
3 4
-5 1
0 -6
2 2
Output #1
3
Input #2
3
0 0
1 0
0 -1
Output #2
2

Sign in to submit a solution

Signing up is free and takes a minute.