#include <bits/stdc++.h>
using std::max;
const double eps = 1e-15;
const int nn = 2e3 + 5;
int n, a, b;
double u[nn], v[nn], q[nn];
struct state {
  double val;
  int a, b;
  inline bool operator<(const state &v) const { return val < v.val; }
  inline state operator+(state v) {
    return (state){val + v.val, a + v.a, b + v.b};
  }
} f[nn];
void check2(double x, double y) {
  f[0] = {0, 0, 0};
  for (int i = 1; i <= n; i++) {
    f[i] = max(f[i - 1], f[i - 1] + (state){q[i] - x - y, 1, 1});
    f[i] = max(f[i], f[i - 1] + (state){u[i] - x, 1, 0});
    f[i] = max(f[i], f[i - 1] + (state){v[i] - y, 0, 1});
  }
}
double l2;
void check1(double cost) {
  double l = 0, r = 1;
  while (r - l > eps) {
    double mid = (l + r) / 2;
    check2(cost, mid);
    if (f[n].b >= b)
      l = mid;
    else
      r = mid;
  }
  check2(cost, l);
  l2 = l;
}
int main() {
  scanf("%d %d %d", &n, &a, &b);
  for (int i = 1; i <= n; i++) scanf("%lf", u + i);
  for (int i = 1; i <= n; i++) scanf("%lf", v + i);
  for (int i = 1; i <= n; i++) q[i] = u[i] + v[i] - u[i] * v[i];
  double l = 0, r = 1;
  while (r - l > eps) {
    double mid = (l + r) / 2;
    check1(mid);
    if (f[n].a >= a)
      l = mid;
    else
      r = mid;
  }
  check1(l);
  printf("%.5lf\n", f[n].val + l * a + l2 * b);
}
