#C11507. Closest Parking Slot
Closest Parking Slot
Closest Parking Slot
You are given coordinates of parking slots in a parking lot. Your task is to determine the parking slot that is closest to the entrance located at (0, 0). The distance is measured using the squared Euclidean distance given by \(x^2 + y^2\). In case two parking slots have the same distance to the entrance, choose the one with the smaller x coordinate; if x coordinates are equal, choose the one with the smaller y coordinate.
Note: Use the squared distance to avoid unnecessary floating point computations.
inputFormat
The first line of input contains a single integer \(N\) denoting the number of available parking slots. Each of the following \(N\) lines contains two space-separated integers \(x\) and \(y\) representing the coordinates of a parking slot.
Example:
5 3 4 1 2 3 3 2 2 1 1
outputFormat
Output a single line with two space-separated integers representing the coordinates of the parking slot closest to the entrance.
Example Output:
1 1## sample
1
2 3
2 3
</p>