#include <bits/stdc++.h>
const double eps = 1e-10;
struct data {
  double ans;
  int a, b;
  inline bool operator<(const data &x) const { return ans < x.ans; }
} dp[2005];
double p[2005], q[2005];
void work(int n, double x, double y) {
  dp[0] = {0.0, 0, 0};
  for (int i = 0; i < n; i++) {
    dp[i + 1] = dp[i];
    dp[i + 1] =
        std::max(dp[i + 1], {dp[i].ans + p[i] - x, dp[i].a + 1, dp[i].b});
    dp[i + 1] =
        std::max(dp[i + 1], {dp[i].ans + q[i] - y, dp[i].a, dp[i].b + 1});
    dp[i + 1] =
        std::max(dp[i + 1], {dp[i].ans + 1 - (1 - p[i]) * (1 - q[i]) - x - y,
                             dp[i].a + 1, dp[i].b + 1});
  }
}
inline double calc(int n, double x, int b) {
  double l = 0, r = 1;
  while (r - l > eps) {
    double m = (l + r) / 2;
    work(n, x, m);
    if (dp[n].b <= b)
      r = m;
    else
      l = m;
  }
  return r;
}
int main() {
  int n, a, b;
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 0; i < n; i++) scanf("%lf", p + i);
  for (int i = 0; i < n; i++) scanf("%lf", q + i);
  double l = 0, r = 1;
  while (r - l > eps) {
    double m = (l + r) / 2;
    work(n, m, calc(n, m, b));
    if (dp[n].a <= a)
      r = m;
    else
      l = m;
  }
  double x = calc(n, r, b);
  work(n, r, x);
  printf("%.10lf\n", dp[n].ans + a * r + b * x);
  return 0;
}
