Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n, m, x, y, px, py;
- cin >> n >> m >> x >> y;
- if (m > n) {
- n = m + n;
- m = n - m;
- n = n - m;
- }
- px = m - x;
- py = n - y;
- if (x < y && x < px && x < py) {
- cout << x;
- }
- else if (y < x && y < px && y < py) {
- cout << y;
- }
- else if (px < x && px < y && px < py) {
- cout << px;
- }
- else {
- cout << py;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement