Zadatak45-KUPBG

include <iostream>

using namespace std;

int main()
{
int n,m,a,b,c,br=0,i,j,k;
cin>>a>>b>>c>>m>>n;
for(i=0;i<m;i++)
for(j=0;j<m;j++)
for(k=0;k<m;k++)
{
if((a*i+b*j+c*k==n)and(i+k+j==m))

br++;
}
cout<<br;

return 0;
}

Advertisements