#include #include int N, M; int A[10], B[10]; int cost[1<<10]; int dp[11][1<<10]; int main(){ scanf("%d", &N); for(int i=0;i> j & 1){ c += A[j]; } } cost[i] = c; } std::fill(&dp[0][0], &dp[0][0]+11*(1<<10), 100); dp[0][0] = 0; for(int i=0;i B[i]){continue;} dp[i+1][j|k] = std::min(dp[i+1][j|k], dp[i][j] + 1); } } } if(dp[M][(1<