#include<bits/stdc++.h>
using namespace std;
#define FOR(i,s,t) for(int i = s; i < t ; ++i)
#define ALL(a) a.begin(),a.end()
#define SORT(a) sort(ALL(a))
#define UNIQ(a) a.erase(unique(ALL(a)),a.end())
#define debug(a) cerr<<#a":="<<a<<endl;
#define SZ(a) (int)a.size()
using LL = long long; template<class T> using V = vector <T>; template <class T> using VV = V<V<T>>;


int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);

	int N, M, K; cin >> N >> M >> K;
	V<int>a(N), b(N);
	FOR(i, 0, N) {
		cin >> a[i];
	}
	FOR(i, 0, N) {
		cin >> b[i];
	}
	LL ans = 0;
	FOR(state, 0, 1 << N) {
		if (__builtin_popcount(state) > K)continue;
		LL ret = 0;
		V<int>ord;
		FOR(i, 0, N) {
			if (state & 1 << i)
				ord.push_back(i);
		}
		do {
			LL sub = 0;
			int MM = M;
			FOR(i, 0, SZ(ord)) {// M個植えれる
				LL sz = min(MM, b[ord[i]]);
				MM -= sz;
				sub += sz * a[ord[i]];
			}
			sub += MM;
			ret = max(ret, sub);
		} while (next_permutation(ALL(ord)));

		ans = max(ans, ret);
	}
	
	cout << ans << endl;

	return 0;
}
