20. Which Quadrant?
Core1000 ms256 MBSolved by 0%
Read the x and y coordinates of a point and print which quadrant it lies in:
1when both are positive2when x is negative and y is positive3when both are negative4when x is positive and y is negativeOriginwhen both are zeroAxiswhen exactly one of them is zero
Constraints - `-1000000 ≤ x, y ≤ 1000000`
Input
A single line containing two integers, separated by a space.
Output
Print 1, 2, 3 or 4 for the quadrant, or the word Origin or Axis.
Input3 4
Output1
Noteis in the first quadrant
Input-2 5
Output2
Noteis in the second quadrant
Hint 1Approach
Hint 2Approach
Hint 3Pseudocode
Hint 4Full solution