这样做的:
#include <iostream>
using namespace std;
int main() {
int x, y;
if (cin >> x >> y && 1 <= x && x <= 1000 && 1 <= y && y <= 1000) {
int a = 4 * x - y;
int b = a / 2;
if (a % 2 == 0 && b >= 0 && b <= x) {
cout << b << endl << x - b << endl;
} else {
cout << "No solution" << endl;
}
} else {
cout << "Invalid input" << endl;
}
return 0;
}