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