#include <bits/stdc++.h>
const int kN = 2005;
const double eps = 1e-8;
int n, a, b;
int cnt_a[kN], cnt_b[kN];
double p[kN], u[kN], f[kN];
void calc(double cost_a, double cost_b) {
  for (int i = 1; i <= n; i++) {
    f[i] = f[i - 1];
    cnt_a[i] = cnt_a[i - 1];
    cnt_b[i] = cnt_b[i - 1];
    if (f[i - 1] + p[i] - cost_a > f[i]) {
      f[i] = f[i - 1] + p[i] - cost_a;
      cnt_a[i] = cnt_a[i - 1] + 1;
      cnt_b[i] = cnt_b[i - 1];
    }
    if (f[i - 1] + u[i] - cost_b > f[i]) {
      f[i] = f[i - 1] + u[i] - cost_b;
      cnt_a[i] = cnt_a[i - 1];
      cnt_b[i] = cnt_b[i - 1] + 1;
    }
    if (f[i - 1] + 1 - (1 - u[i]) * (1 - p[i]) - cost_a - cost_b > f[i]) {
      f[i] = f[i - 1] + 1 - (1 - u[i]) * (1 - p[i]) - cost_a - cost_b;
      cnt_a[i] = cnt_a[i - 1] + 1;
      cnt_b[i] = cnt_b[i - 1] + 1;
    }
  }
}
void solve() {
  double l1 = 0, r1 = 1, l2, r2;
  while (r1 - l1 > eps) {
    double mid1 = (l1 + r1) / 2;
    l2 = 0, r2 = 1;
    while (r2 - l2 > eps) {
      double mid2 = (l2 + r2) / 2;
      calc(mid1, mid2);
      if (cnt_b[n] > b) {
        l2 = mid2;
      } else {
        r2 = mid2;
      }
    }
    calc(mid1, r2);
    if (cnt_a[n] > a) {
      l1 = mid1;
    } else {
      r1 = mid1;
    }
  }
  calc(r1, r2);
  printf("%.6lf\n", f[n] + a * r1 + b * r2);
}
int main() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 1; i <= n; i++) {
    scanf("%lf", p + i);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%lf", u + i);
  }
  solve();
  return 0;
}
