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

~/algor $ cat problems/funksiya-nuqtalar-choraklari

Which quadrant

Easy 1000 ms 128 MB 25%
Share

Write a function Quadrant(x, y) that returns the number of the coordinate quadrant containing the point $(x; y)$, or $0$ if the point lies on an axis. Quadrants: $1$ — $x \gt 0$, $y \gt 0$; $2$ — $x \lt 0$, $y \gt 0$; $3$ — $x \lt 0$, $y \lt 0$; $4$ — $x \gt 0$, $y \lt 0$.

Example 1: Quadrant(3, 5) → 1

Example 2: Quadrant(-2, -7) → 3

Write only the function body.

The two coordinates of a point go into the function Quadrant, which returns the quadrant number

Input

One line with two integers $x$ and $y$ — the arguments of the function.

Output

The value returned by the function: $0$, $1$, $2$, $3$ or $4$.

Note

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

Examples

Input #1
3 5
Output #1
1
Input #2
-2 -7
Output #2
3

Sign in to submit a solution

Signing up is free and takes a minute.