34. Which Quadrant?

Acceptance — 0 accepted 0 submissions

Easy
ConditionalsMath
No companies listed
A drone pilot reports the drone's position as a point (x, y) on a graph.

Tell where the point lies:
• Quadrant 1 (x > 0, y > 0), Quadrant 2 (x < 0, y > 0), Quadrant 3 (x < 0, y < 0), Quadrant 4 (x > 0, y < 0)
• Origin if both are 0
• X-axis if only y is 0, Y-axis if only x is 0

Input Format
A single line with two integers x and y.

Output Format
Print one of: Quadrant 1, Quadrant 2, Quadrant 3, Quadrant 4, Origin, X-axis, Y-axis.

Constraints
• -1000 ≤ x, y ≤ 1000

Example 1

Input
3 4
Output
Quadrant 1

Explanation Both positive, so Quadrant 1.

Example 2

Input
-2 5
Output
Quadrant 2

Explanation x negative and y positive, so Quadrant 2.

Example 3

Input
0 0
Output
Origin

Explanation The drone is at the centre.

Example 4

Input
7 0
Output
X-axis

Explanation y is 0, so the point is on the X-axis.

Acceptance —
Accepted 0
Submissions 0
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
Quadrant 1
No results yet
Run your code to test it against the sample cases.
Problem List