Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program AA;
- var
- x, y, n, m: longint;
- begin
- readln(m, n);
- readln(x, y);
- if (n > 1) then
- if (y = 1) then
- writeln(x, ' ', y + 1)
- else if y = n then
- writeln(x, ' ', y - 1)
- else
- begin
- writeln(x, ' ', y - 1);
- writeln(x, ' ', y + 1);
- end;
- if m > 1 then
- if x = 1 then
- writeln(x + 1, ' ', y)
- else if x = m then
- writeln(x - 1, ' ', y)
- else
- begin
- writeln(x - 1, ' ', y);
- writeln(x + 1, ' ', y);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement