#include #include using namespace std; using lint=int64_t; int N; int M[20]; int memo[(1<<20)]; int teika[(1<<20)]; int rec(int stat) { if(stat==0) return 0; if(memo[stat]!=1e9) return memo[stat]; int res=1e9; for(int i=0;i> N; for(int i=0;i> M[i]; for(int stat=0;stat<(1<