Editorial for CCC '17 J1 - Quadrant Selection


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Author: Kirito

The problem is asking you to find which quadrant a given point belongs to.

A point at coordinates (12,5) lies in quadrant 1 since both its x and y values are positive.

A point at coordinates (-12,5) lies in quadrant 2 since its x value is negative and its y value is positive.

A point at coordinates (-12,-5) lies in quadrant 3 since both its x and y values are negative.

A point at coordinates (12,-5) lies in quadrant 4 since its x value is positive and its y value is negative.

Time Complexity: \mathcal O(1)


Comments

There are no comments at the moment.