1 solutions

  • 0
    @ 2024-12-5 18:19:39

    C++ :

    #include <iostream>
    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
    9147
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By