#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;

typedef pair<int,int>P;

int n,m,k,a[111],b[111],ans;

void dfs(int d,int sum,vector<int> v){
  if(sum>k)return;
  if(d==n){
    vector<P>V;
    r(i,v.size())V.push_back(P(a[v[i]],b[v[i]]));
    sort(V.begin(),V.end(),greater<P>());
    int N=m,cnt=0;
    r(i,V.size()){
      if(N<=0)break;
      int cost=V[i].first;
      int lim=V[i].second;
      int x=min(N,lim);
      cnt+=x*cost;
      N-=lim;
    }
    ans=max(ans,cnt+max(N,0));
  }
  else{
    dfs(d+1,sum,v);
    v.push_back(d);
    dfs(d+1,sum+1,v);
  }
}

int main(){
  cin>>n>>m>>k;
  r(i,n)cin>>a[i];
  r(i,n)cin>>b[i];
  vector<int>v;
  dfs(0,0,v);
  cout<<ans<<endl;
}
