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

~/algor $ cat problems/chorak-raqami

Quadrant number

Easy 1000 ms 64 MB 23%
Share

A point $(x; y)$ that does not lie on the coordinate axes is given. Determine the number of the quadrant it lies in ($1$, $2$, $3$ or $4$).

The numbers of the four quadrants of the coordinate plane

Input

One line with two integers: $x$ and $y$.

Output

One integer: the quadrant number ($1$, $2$, $3$ or $4$).

Note

$-10^{9} \le x, y \le 10^{9}$
$x \ne 0, y \ne 0$

Examples

Input #1
1 1
Output #1
1
Input #2
-1 1
Output #2
2

Sign in to submit a solution

Signing up is free and takes a minute.