#include #include #include #include using namespace std; const int M=1<<11; const int MAX=0x1f1f1f1f; int s[25],dp[25][M]; int t[M]; int a[11]; int main() { int N,i,j,k,len,tmp,r; for(i=0;i>1; } t[i]=tmp; } while(scanf("%d",&N)!=EOF) { memset(s,0,sizeof(s));; for(i=0;i