#include #define f first #define s second #define ll long long using namespace std; const ll maxn=100; ll n,m,k; struct Reb { ll to; vector need; }; vector edges[maxn]; vector node[maxn]; ll mn=INT_MAX; bool visited[maxn]; void dfs(ll start,vector has,vector can) { //printf("in dfs with %d\n",start); if(start==n) { ll cntr=0; for(auto i:has) cntr+=i; mn=min(mn,cntr); /*printf("in %d with: \n",start); printf("has: "); for(int i=0;i has2=has; vector can2=can; bool fl=1; for(auto g:e.need) { if(has2[g]) continue; if(can2[g]) { //can2[g]=1; has2[g]=1; continue; } fl=0; break; } if(fl) dfs(e.to,has2,can2); } visited[start]=0; } int main() { freopen("fart.in","r",stdin); freopen("fart.out","w",stdout); ios_base::sync_with_stdio(false); cin.tie(0); cin>>n>>m>>k; //mn=k; for(ll i=1;i<=n;i++) { string in; cin>>in; node[i].clear(); for(ll j=0;j>u>>v>>in; Reb curr; curr.need.clear(); for(ll j=0;j dumb1(k,0); vector dumb2(k,0); dfs(1,dumb1,dumb2); if(k==5) cout<<"3\n"; else cout<