Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- int x,y,z,w;
- // freopen("input.txt", "r", stdin);
- // freopen("output.txt", "w", stdout);
- // scanf("%d%d%d%d", &x,&y,&z,&w);
- int count = 0;
- int k_z;
- cin >> x >> y >> z >> w;
- for(int i = 0; i <= x; i++){
- for(int j = 0; j <= y; j++){
- k_z = w - i*x - j*y;
- if(k_z%z==0 && k_z >= 0){
- // printf("%d %d %d\n", i, j, k_z);
- count++;
- }
- }
- }
- cout << count << endl;
- // printf("%d\n", count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement