Roots from one#5905

Roots from one

0.5 seconds
64 megabytes
Very easy

There are exactly complex -th roots of unity. Denote these roots as \omega_0, \omega_1, , \omega_{n-1}, where

\omega_k = \cos\left(\frac{2\pi k}{n}\right) + i \sin\left(\frac{2\pi k}{n}\right)

for k = 0, 1, \ldots, n-1.

Given a complex number , find the integer such that \omega_k = z.

Input

The first line contains an integer (1 \le n \le 100).

The second line contains two real numbers and , each with nine digits after the decimal point. It is guaranteed that a + bi is one of the -th roots of unity.

Output

Output the integer such that \omega_k = a + bi.

Examples

Example 1

Loading
Loading