fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int x, y, n, m;
  6.  
  7. int main()
  8. {
  9. cin >> n >> m >> x >> y;
  10. if (x > 1) cout << x - 1 << " " << y << endl;
  11. if (x < n) cout << x + 1 << " " << y << endl;
  12. if (y > 1) cout << x << " " << y - 1 << endl;
  13. if (y < m) cout << x << " " << y + 1 << endl;
  14. }
  15.  
Success #stdin #stdout 0s 4428KB
stdin
Standard input is empty
stdout
Standard output is empty