#include #include #include using namespace std; const int INF = 1e6; int N, C, V; int dp[1501][301]; int main() { cin >> N >> C >> V; vector S(V), T(V), Y(V), M(V); for (int i=0; i> S[i]; for (int i=0; i> T[i]; for (int i=0; i> Y[i]; for (int i=0; i> M[i]; for (int i=0; i<1501; ++i) { for (int j=0; j<=C; ++j) { dp[i][j] = INF; } } dp[1][0] = 0; for (int k=0; k