#include <bits/stdc++.h> using namespace std; int main(){ int n, x, y; cin >> n >> x >> y; for (int i = 1; i <= n / x; i++) { for (int j = 1; j <= i; j++) { if (i * x + j * y == n && i + j >= 5) { cout << i << " " << j << endl; } } } } /************************************************************** Problem: 1394 User: yangjunwen Language: C++ Result: Accepted Time:19 ms Memory:2072 kb ****************************************************************/