提交时间:2025-11-02 10:42:37

运行 ID: 359432

#include <iostream> using namespace std; int main() { int n, x, y; cin >> n >> x >> y; for (int i = n/y; i >= 0; --i) { int j = n - i * y; if ( j>= 0 && j % x == 0) { int a = j / x; cout << a << " " << i << endl; return 0; } } cout << "Impossible" << endl; return 0; }