Where Am I


Submit solution

Points: 100 (partial)
Time limit: 60.0s
Memory limit: 0B

Author:
Problem type
Allowed languages
C, C#, C++, Java, Python

In this problem you will need to determine which quadrant a given point is in. There are four quadrants, numbered from 1 to 4, as shown in the diagram below. Given the X, Y coordinates of a point display 1, 2, 3, or 4 to indicate the quadrant in which the point is located.

Input Specification

Prompt for the input as shown below. Enter two integers, each integer in one line. Neither number can be zero. Data will be entered from console. You do not need to edit the input data. Rerun your application to test each test case.

Output Specification

Output the quadrant number (1, 2, 3 or 4) for the point. Use the format shown below.

Sample Input 1

45
90

Sample Output 1

Q1

Sample Input 2

-10
-95

Sample Output 2

Q3

Comments

There are no comments at the moment.