1 solutions

  • 0
    @ 2023-11-20 17:29:17

    #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;
    

    }

    Information

    ID
    694
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    7
    Tags
    # Submissions
    52
    Accepted
    9
    Uploaded By