Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- long long n, m, p ,q;
- cin >> n >> p >> m >> q;
- long long mod1, mod2;
- mod1 = n - p;
- if(mod1 < 0)
- {
- mod1 *= -1;
- }
- mod2 = m - q;
- if(mod2 < 0)
- {
- mod2 *= -1;
- }
- if(mod1 > mod2)
- {
- cout << min(n + p, m + q);
- }
- else
- {
- cout << max(n - p, m - q);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement