Move a point by one unit in any of the four directions so that it stays within a given distance from a target point.
You are given a point and a target point . In one move, you may shift the point by exactly 1 unit in one of the four cardinal directions: up, down, left, or right.
Find a move that results in a new position that is still within distance from the target point, where distance is measured using the Euclidean metric. In other words, after the move, the squared distance to the target should not exceed .
If there are multiple valid moves, any one of them is acceptable.
For each test case, output two integers — the coordinates of any position reachable in one move from that satisfies the distance constraint.
Example 1
Input
1 0 0 1 1 2
Output
1 0
Explanation
Moving from to gives squared distance , which is within .
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.