2397: Quadrant Selection

Memory Limit:128 MB Time Limit:1.000 S
Creator:
Submit:5 Solved:4

Description

A common problem in mathematics is to determine which quadrant a given point lies in. There are four quadrants, numbered from 1 to 4, as shown in the diagram below:

For example, the point A, which is at coordinates (12, 5) lies in quadrant 1 since both its x and y values are positive, and point B lies in quadrant 2 since its x value is negative and its y value is positive. 
Your job is to take a point and determine the quadrant it is in. You can assume that neither of the two coordinates will be 0.
在数学中,一个常见的问题是确定一个给定点位于哪个象限。有四个象限,编号从 1 到 4,如上图所示:
 例如,点 A 的坐标为 (12, 5),位于第 1 象限,因为它的 x 和 y 值都是正的,而点 B 位于第 2 象限,因为它的 x 值是负的,而 y 值是正的。 
你的任务是取一个点并确定它位于哪个象限。你可以假设两个坐标中没有一个是 0。

Input

The first line of input contains the integer x (−1000 ≤ x ≤ 1000; x != 0). The second line of input contains the integer y (−1000 ≤ y ≤ 1000; y != 0). 
输入的第一行包含整数 x(−1000 ≤ x ≤ 1000; x != 0)。
输入的第二行包含整数 y(−1000 ≤ y ≤ 1000; y != 0)。

Output

Output the quadrant number (1, 2, 3 or 4) for the point (x, y). 
输出点 (x, y) 所在的象限编号(1、2、3 或 4)。

Sample Input

9
-13

Sample Output

4

Source/Category