AC代码:
#include <iostream>
#include <stdio.h>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
int n, m, x, y;
while (cin >> n >> m)
{
if ((m >= 2 * n) && (m <= 4 * n)&&(m%2==0))
{
x = 2 * n - m / 2; y = m / 2 - n;
cout << x << " " << y << endl;
}
else cout << "Error" << endl;
}
return 0;
}