#include #include using namespace std; using ll = long long; #define rep(i, s, t) for (ll i = s; i < (ll)(t); i++) template bool chmin(T &x, T y) { return x > y ? (x = y, true) : false; } template bool chmax(T &x, T y) { return x < y ? (x = y, true) : false; } struct io_setup { io_setup() { ios::sync_with_stdio(false); std::cin.tie(nullptr); cout << fixed << setprecision(15); } } io_setup; int main(){ ll n,d,k; cin>>n>>d>>k; vector a(n),c(n); rep(i,0,n) cin>>a[i]; rep(i,0,n) cin>>c[i]; vector dp(d+1,vector(k+1,-1e18)); dp[0][0]=0; rep(i,0,n){ auto ndp=dp; rep(jj,0,d){ rep(j,0,k+1){ if(dp[jj][j]==-1e18) continue; chmax(ndp[jj+1][min(k,j+c[i])],dp[jj][j]+a[i]); } } swap(ndp,dp); } if(dp[d][k]==-1e18) cout<<"No\n"; else cout<