#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
double p[N], u[N];
pair<double, int> dp[N][N];
bool v[N][N];
int n, a, b;
pair<double, int> calc(int index, int balls_left, double cost) {
  if (index == n + 1) return {0, 0};
  if (v[index][balls_left] == 1) return dp[index][balls_left];
  v[index][balls_left] = 1;
  dp[index][balls_left] = calc(index + 1, balls_left, cost);
  if (balls_left) {
    pair<double, int> tmp = calc(index + 1, balls_left - 1, cost);
    dp[index][balls_left] =
        max(dp[index][balls_left], {tmp.first + p[index], tmp.second});
    dp[index][balls_left] =
        max(dp[index][balls_left],
            {tmp.first + p[index] + u[index] - (p[index] * u[index]) - cost,
             tmp.second - 1});
  }
  pair<double, int> tmp = calc(index + 1, balls_left, cost);
  dp[index][balls_left] =
      max(dp[index][balls_left], {tmp.first + u[index] - cost, tmp.second - 1});
  return dp[index][balls_left];
}
int solve(double cost) {
  memset(v, 0, sizeof(v));
  return -calc(1, a, cost).second;
}
int main() {
  cin >> n >> a >> b;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> u[i];
  }
  double lo = 0, hi = 1, mid;
  for (int big = 0; big < 30; big++) {
    mid = (lo + hi) / double(2);
    if (solve(mid) > b)
      lo = mid;
    else
      hi = mid;
  }
  solve(hi);
  double ans = dp[1][a].first + hi * b;
  cout << setprecision(4) << fixed << ans << endl;
}
