#include #include #include using namespace std; vector Cost[51][51], Time[51][51]; int N, C, V; unsigned res; void dfs(int p, unsigned m, unsigned t) { if (m>C or t>res) return; if (p==N) res=t; for(int i=p+1;i<=N;++i) for(int j=0;j>N>>C>>V) { for(int i=1;i<=N;++i) for(int j=1;j<=N;++j) { Cost[i][j].clear(); Time[i][j].clear(); } vector s(V), t(V), y(V), m(V); for(int& x: s) cin>>x; for(int& x: t) cin>>x; for(int& x: y) cin>>x; for(int& x: m) cin>>x; for(int i=0;i