#include <bits/stdc++.h>
const double eps = 1e-9;
const int MAXN = 2333;
struct node {
  double f;
  int numa, numb;
  node() : f(0), numa(0), numb(0) {}
  node(double a, int b, int c) : f(a), numa(b), numb(c) {}
} dp[MAXN];
int n, a, b;
double pa[MAXN], pb[MAXN];
void gao(double ca, double cb) {
  for (int i = 1; i <= n; ++i) {
    dp[i] = dp[i - 1];
    if (dp[i].f < dp[i - 1].f + pa[i] - ca - eps) {
      dp[i] =
          node(dp[i - 1].f + pa[i] - ca, dp[i - 1].numa + 1, dp[i - 1].numb);
    }
    if (dp[i].f < dp[i - 1].f + pb[i] - cb - eps) {
      dp[i] =
          node(dp[i - 1].f + pb[i] - cb, dp[i - 1].numa, dp[i - 1].numb + 1);
    }
    if (dp[i].f < dp[i - 1].f + pa[i] - ca + pb[i] - cb - pa[i] * pb[i] - eps) {
      dp[i].f = dp[i - 1].f + pa[i] - ca + pb[i] - cb - pa[i] * pb[i];
      dp[i].numa = dp[i - 1].numa + 1, dp[i].numb = dp[i - 1].numb + 1;
    }
  }
}
double chk(double SUBARU) {
  double l = 0, r = 1;
  for (int T = 0; T < 50; ++T) {
    double mid = (l + r) / 2;
    gao(SUBARU, mid);
    if (dp[n].numb > b)
      l = mid;
    else
      r = mid;
  }
  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 v = 0;
  double l = 0, r = 1;
  for (int T = 0; T < 50; ++T) {
    double mid = (l + r) / 2;
    v = chk(mid);
    if (dp[n].numa > a)
      l = mid;
    else
      r = mid;
  }
  gao(l, v);
  printf("%.5lf", dp[n].f + l * a + v * b);
  return 0;
}
