1 solutions
-
0
#include<bits/stdc++.h> using namespace std; int main() { int x, y, z, n, m, cnt = 0; cin >> x >> y >> z >> n >> m;
for (int gj = 0; gj * x <= n && gj <= m; gj++) for (int mj = 0; mj * y + gj * x <= n && mj + gj <= m; mj++) { int xj = (n - gj * x - mj * y) * z; if (gj + mj + xj == m) cnt++; } cout << cnt << endl; return 0;
}
- 1
Information
- ID
- 694
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 7
- Tags
- # Submissions
- 66
- Accepted
- 12
- Uploaded By