#include using namespace std; using ll = long long; #define all(a) (a).begin(), (a).end() #define pb push_back #define fi first #define se second mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count()); const ll MOD1000000007 = 1000000007; const ll MOD998244353 = 998244353; const ll MOD[3] = {999727999, 1070777777, 1000000007}; const ll LINF = 1LL << 60LL; const int IINF = (1 << 30) - 2; void solve(){ int n, m, k; cin >> n >> m >> k; vector x(k); for(int i=0; i> x[i]; x[i]--; } vector> A(n, vector(n, false)); for(int i=0; i> u >> v; u--; v--; A[u][v] = A[v][u] = true; } vector>> dp(n, vector>(n, vector(1<>i)&1){ int bit2 = bit ^ (1<>j)&1) && A[i][j]){ dp[s][i][bit] = dp[s][i][bit] | dp[s][j][bit2]; } } } } vector>> reachable(n, vector>(n, vector(n+1, false))); for(int s=0; s>i)&1) cnt++; reachable[s][t][cnt] = reachable[s][t][cnt] | dp[s][t][bit]; } } for(int l=0; l<=n; l++){ for(int t=0; t> T; while(T--) solve(); }