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
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.