#include using namespace std; #define rep(i, n) for( int i = 0; i < n; i++ ) using ll = long long; int main() { int N, D, K; cin >> N >> D >> K; vector a(N), c(N); rep(i, N) cin >> a[i]; rep(i, N) cin >> c[i]; ll INF = 1e18; vector> dp(D + 1, vector(K + 1, -INF)); dp[0][0] = 0; auto chmax = [&](ll &d, ll s) { d = max(d, s); }; rep(i, N) { vector> nxt(D + 1, vector(K + 1, -INF)); nxt = dp; rep(j, D) { rep(k, K) { if(dp[j][k] == -INF) continue; ll t = k + c[i]; if(t > K) t = K; chmax(nxt[j + 1][t], dp[j][k] + a[i]); } } swap(dp, nxt); } ll ans = dp[D][K]; if(ans == -INF) cout << "No" << endl; else cout << ans << endl; }