func_code_string: #include <bits/stdc++.h>   long long mod = 1000000007;   using namespace std;   int n, m;   long long b;   struct node {     int money, monitors, pre;     vector<int> G;   } a[202];   bool cmp(node x, node y) { return x.monitors > y.monitors; }   long long dp[2][1 << 20];   int setbit(int x, int pos) { return x | (1 << pos); }   bool checkbit(int x, int pos) { return x & (1 << pos); }   long long powmod(long long a, long long b) {     long long res = 1;     a %= mod;     for (; b; b >>= 1) {       if (b & 1) res = res * a % mod;       a = a * a % mod;     }     return res;   }   int has[25];   int main() {     int i, j, fl, test, index, mask, cnt = 0;     scanf( %d%d%lld , &n, &m, &b);     for (i = 0; i < n; i++) {       scanf( %d%d%d , &a[i].money, &a[i].monitors, &j);       while (j--) {         scanf( %d , &fl);         fl--;         a[i].pre = setbit(a[i].pre, fl);         a[i].G.push_back(fl);         if (has[fl] == 0) {           cnt++;           has[fl] = 1;         }       }     }     if (cnt < m) {       printf( -1 n );       return 0;     }     sort(a, a + n, cmp);     int tmask, touse;     for (index = n; index >= 0; index--) {       for (mask = 0; mask < (1 << m); mask++) {         touse = index % 2;         if (mask == (1 << m) - 1) {           dp[touse][mask] = 0ll;           continue;         }         if (index == n) {           dp[touse][mask] = -2;           continue;         }         int i;         long long op1, op2 = a[index].money, op3;         op1 = dp[(touse + 1) % 2][mask];         if (mask == 0) op2 += a[index].monitors * b;         tmask = mask;         tmask = tmask | a[index].pre;         op3 = dp[(touse + 1) % 2][tmask];         if (op1 == -2 && op3 == -2)           dp[touse][mask] = -2;         else if (op1 != -2 && op3 != -2)           dp[touse][mask] = min(op1, op2 + op3);         else if (op1 == -2)           dp[touse][mask] = op2 + op3;         else           dp[touse][mask] = op1;       }     }     long long ans = dp[0][0];     if (ans == -2)       printf( -1 n );     else       printf( %lld n , ans);     return 0;   }   