#include #include using namespace std; int main() { int n; while (cin>>n) { int s=0; vector w(n); for(auto& v: w) { cin>>v; s+=v; } vector d(s+1); d[0]=1; for(int i=0;i