Coordinates of Neighbors
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
For a cell located at coordinates (x, y) within a table of dimensions M×N, determine and output the coordinates of its neighboring cells. Neighboring cells are defined as those that share a side with the given cell.
Input
You are provided with natural numbers M, N, x, y (1 ≤ x ≤ M ≤ 10^9, 1 ≤ y ≤ N ≤ 10^9).
Output
Print the coordinate pairs of the neighboring cells of the specified cell, in any order.
Examples
Input #1
Answer #1
Submissions 7K
Acceptance rate 43%