#include <bits/stdc++.h>
using namespace std;
double f[2005];
int g[2005], h[2005];
int n, a, b;
double pa[2005], pb[2005];
double effect;
const double eps = 1e-8;
void cmax(double& a, int& b, int& e, double c, int d, int f) {
  if (a + eps < c) {
    a = c;
    b = d;
    e = f;
  }
}
void check(double k, double l) {
  effect = 0;
  memset(f, 0, sizeof(f));
  memset(g, 0, sizeof(g));
  memset(h, 0, sizeof(h));
  for (int i = 1; i <= n; ++i) {
    cmax(f[i], g[i], h[i], f[i - 1], g[i - 1], h[i - 1]);
    cmax(f[i], g[i], h[i], f[i - 1] + pa[i] - k, g[i - 1] + 1, h[i - 1]);
    cmax(f[i], g[i], h[i], f[i - 1] + pb[i] - l, g[i - 1], h[i - 1] + 1);
    cmax(f[i], g[i], h[i], f[i - 1] + pb[i] - l + pa[i] - k - (pa[i] * pb[i]),
         g[i - 1] + 1, h[i - 1] + 1);
  }
}
double solve(double k) {
  double l = 0, r = 1;
  while (r - l > eps) {
    double mid = (l + r) / 2.0;
    check(k, mid);
    if (h[n] < b)
      r = mid;
    else
      l = mid;
  }
  check(k, l);
  return l;
}
int main() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 1; i <= n; ++i) scanf("%lf", &pa[i]);
  for (int i = 1; i <= n; ++i) scanf("%lf", &pb[i]);
  double l = 0, r = 1, k = 0;
  while (r - l > eps) {
    double mid = (l + r) / 2.0;
    k = solve(mid);
    if (g[n] < a)
      r = mid;
    else
      l = mid;
  }
  printf("%f\n", f[n] + k * b + l * a);
}
