#include<cstdio>
using namespace std;
const int b[7]={0,1,2,3,5,10,20};
int n,w[1001],f[1001],ans;
int main()
{
n=0;
for(int i=1;i<=6;i++){
int x;
scanf("%d",&x);
for(;x;x--)w[++n]=b[i];
}
f[0]=1;
for(int i=1;i<=n;i++)
for(int j=1000;j>=1;j--)
if(j-w[i]>=0&&f[j-w[i]])f[j]=1;
ans=0;
for(int i=1000;i>=1;i--)
if(f[i])
ans++;
printf("Total=%d\n",ans);
return 0;
}
/*
in:1 1 0 0 0 0 out:Total=3
in:2 2 0 0 0 0 out:Total=6
in:1 0 3 0 0 0 out:Total=7
in:3 4 0 5 0 0 out:Total=36
in:2 2 2 2 2 2 out:Total=82
in:0 3 2 7 4 5 out:Total=185
in:0 6 3 4 2 1 out:Total=79
in:1 2 3 4 5 6 out:Total=204
in:6 5 4 3 2 1 out:Total=83
in:10 10 10 10 1 1 out:Total=140
*/
砝码称重
最新推荐文章于 2024-04-12 10:57:41 发布