#include #include #include #include #include #include // istringstream #include // sort #include // pair #include // DBL_MAX typedef long long ll; using namespace std; const int maxN = 50; const int maxM = 1000; struct log { int pos; int cost; int time; }; int main(){ ll N,C,V; // [50],[300],[1500] cin >> N >> C >> V; vector ss(V), ts(V), cs(V), ms(V); for(int i=0; i> ss[i]; } for(int i=0; i> ts[i]; } for(int i=0; i> cs[i]; } for(int i=0; i> ms[i]; } queue roots; struct log tmp = {1,0,0}; roots.push(tmp); int minTime = maxN*maxM; while(true){ if(roots.empty()){ break; } struct log crr = roots.front(); for(int i=0; i