#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0;
  char zf = 1;
  char ch = getchar();
  while (ch != '-' && !isdigit(ch)) ch = getchar();
  if (ch == '-') zf = -1, ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * zf;
}
void write(long long y) {
  if (y < 0) putchar('-'), y = -y;
  if (y > 9) write(y / 10);
  putchar(y % 10 + 48);
}
void writeln(const long long y) {
  write(y);
  putchar('\n');
}
int i, j, k, m, n, x, y, z, cnt, A, B;
double p1[2055], p2[2055], ans;
double f[2055];
int c[2055], s[2055];
int check(double x) {
  double L = -1, R = 1;
  while (R - L >= 0.0000001) {
    double mid = (L + R) / 2;
    for (register int i = 1; i <= n; i++) {
      c[i] = c[i - 1];
      s[i] = s[i - 1];
      f[i] = f[i - 1];
      double w = f[i - 1] + p1[i] - x;
      if (w >= f[i]) f[i] = w, c[i] = c[i - 1], s[i] = s[i - 1] + 1;
      w = f[i - 1] + p2[i] - mid;
      if (w >= f[i]) f[i] = w, c[i] = c[i - 1] + 1, s[i] = s[i - 1];
      w = f[i - 1] + 1.0 - (1.0 - p1[i]) * (1.0 - p2[i]) - x - mid;
      if (w >= f[i]) f[i] = w, c[i] = c[i - 1] + 1, s[i] = s[i - 1] + 1;
    }
    ans = f[n] + B * mid + A * x;
    if (c[n] == B)
      break;
    else if (c[n] > B)
      L = mid;
    else
      R = mid;
  }
  return s[n];
}
int main() {
  n = read();
  A = read();
  B = read();
  for (register int i = 1; i <= n; i++) cin >> p1[i];
  for (register int i = 1; i <= n; i++) cin >> p2[i];
  double L = -1, R = 1;
  while (R - L >= 0.0000001) {
    const double mid = (L + R) / 2;
    int sl = check(mid);
    if (sl == A) break;
    if (sl > A)
      L = mid;
    else
      R = mid;
  }
  printf("%.6f\n", ans);
  return 0;
}
