//#include #include using namespace std; //using namespace atcoder; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector>; vector> BOX; //max C size 通りの全列挙 int k = 0; vector now_vector; void next_combination(int size, int max, int k) { if (k == size) { BOX.push_back(now_vector); } else { if (k == 0) { for (int i = 0; i < max; i++) { now_vector[k] = i; k++; next_combination(size, max, k); k--; } } else { int LAST = now_vector[k - 1]; for (int i = LAST + 1; i < max; i++) { now_vector[k] = i; k++; next_combination(size, max, k); k--; } } } return; } int main() { int N, K; cin >> N >> K; vector C(9); vector D; for(int i=0;i<9;i++) { cin >> C[i]; for(int j=C[i]-1;j>=0;j--)D.push_back(i + 1); } int n = N / 2; now_vector.assign(n, -1); next_combination(n, N, 0); ll an = 0; unordered_set Poo; vector> KK(14,vector (10)); ll as=1; for(int i=0;i=0;i--) { string AU; unordered_set S; for(int k=0;k M1; do { x = 0; for(int u=0;u