#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef vector VI; typedef vector VVI; typedef vector VL; typedef vector VVL; typedef long long LL; #define all(a) (a).begin(), (a).end() #define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl #define ALL(a) (a).begin(),(a).end() #define pb push_back LL dp[502][503],ddp[502][503]; bool K[502][503],KK[502][503]; void kou(int j,int k,LL x){ if(KK[j][k]==0){ KK[j][k]=1; ddp[j][k]=x; } else{ ddp[j][k]=max(ddp[j][k],x); } } int main() { int n,d,k; cin>>n>>d>>k; int A[n],C[n]; rep(i,n){cin>>A[i];} rep(i,n){cin>>C[i];} K[0][0]=1; rep(i,n){ int ii=min(i,d); rep(j,k+1)rep(l,ii+1){KK[j][l]=0;} rep(j,k+1)rep(l,ii+1){ if(K[j][l]){kou(j,l,dp[j][l]);kou(min(k,j+C[i]),l+1,dp[j][l]+A[i]);} } rep(j,k+1)rep(l,ii+2){K[j][l]=KK[j][l]; dp[j][l]=ddp[j][l];} } if(K[k][d]==0){ cout<<"No"<