#include <bits/stdc++.h>
using namespace std;
int n, a, b;
double p[2010], u[2010];
pair<double, int> dp[2010][2010];
pair<double, int> go(double lambda) {
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= a; j++) {
      dp[i][j] = dp[i - 1][j];
      if (j > 0) {
        dp[i][j] = max(dp[i][j], {dp[i - 1][j - 1].first + p[i - 1],
                                  dp[i - 1][j - 1].second});
        dp[i][j] =
            max(dp[i][j], {dp[i - 1][j - 1].first + 1.0 -
                               (1.0 - u[i - 1]) * (1.0 - p[i - 1]) - lambda,
                           dp[i - 1][j - 1].second + 1});
      }
      dp[i][j] = max(dp[i][j], {dp[i - 1][j].first + u[i - 1] - lambda,
                                dp[i - 1][j].second + 1});
    }
  }
  return dp[n][a];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> u[i];
  }
  double l = 0, r = 1e18;
  auto p = go(l);
  while (l + 1e-9 < r) {
    double mid = (l + r) / 2;
    p = go(mid);
    if (p.second <= b)
      r = mid;
    else
      l = mid;
  }
  cout << fixed << setprecision(10) << p.first + b * l;
}
