题目:https://www.cnblogs.com/Renyi-Fan/archive/2017/06/09/6970166.html#_label1
#include<bits/stdc++.h>
using namespace std;
int f[45],a[45],n;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}
f[0]=1;
for(int i=1;i<=n;i++){
for(int j=a[i];j<=40;j++){
f[j]=f[j-a[i]]+1;
}
}
cout<<f[40];
return 0;
}