Problem: Gosha is hunting. His goal is to catch as many Pokemons as possible. Gosha has a Poke Balls and b Ultra Balls. There are n Pokemons. They are numbered 1 through n. Gosha knows that if he throws a Poke Ball at the i-th Pokemon he catches it with probability pi. If he throws an Ultra Ball at the i-th Pokemon he catches it with probability ui. He can throw at most one Ball of each type at any Pokemon.

The hunting proceeds as follows: at first, Gosha chooses no more than a Pokemons at which he will throw Poke Balls and no more than b Pokemons at which he will throw Ultra Balls. After that, he throws the chosen Balls at the chosen Pokemons. If he throws both Ultra Ball and Poke Ball at some Pokemon, he is caught if and only if he is caught by any of these Balls. The outcome of a throw doesn't depend on the other throws.

Gosha would like to know what is the expected number of the Pokemons he catches if he acts in an optimal way. In other words, he would like to know the maximum possible expected number of Pokemons can catch.

Input

The first line contains three integers n, a and b (2 ≤ n ≤ 2000, 0 ≤ a, b ≤ n) — the number of Pokemons, the number of Poke Balls and the number of Ultra Balls.

The second line contains n real values p1, p2, ..., pn (0 ≤ pi ≤ 1), where pi is the probability of catching the i-th Pokemon if Gosha throws a Poke Ball to it.

The third line contains n real values u1, u2, ..., un (0 ≤ ui ≤ 1), where ui is the probability of catching the i-th Pokemon if Gosha throws an Ultra Ball to it.

All the probabilities are given with exactly three digits after the decimal separator.

Output

Print the maximum possible expected number of Pokemons Gosha can catch. The answer is considered correct if it's absolute or relative error doesn't exceed 10 - 4.

Examples

Input

3 2 2
1.000 0.000 0.500
0.000 1.000 0.500


Output

2.75


Input

4 1 3
0.100 0.500 0.500 0.600
0.100 0.500 0.900 0.400


Output

2.16


Input

3 2 0
0.412 0.198 0.599
0.612 0.987 0.443


Output

1.011

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long DENOM = 1000;
struct result {
  long long score;
  int a_count, b_count, either;
  bool operator<(const result &other) const { return score < other.score; }
  result &operator+=(const result &other) {
    score += other.score;
    a_count += other.a_count;
    b_count += other.b_count;
    either += other.either;
    return *this;
  }
};
int N, A, B;
vector<long long> PA, PB, PAB;
bool is_acceptable(const result &res) {
  return res.a_count <= A && res.b_count <= B &&
         res.a_count + res.b_count + res.either <= A + B;
}
result evaluate(long long AC, long long BC, bool final = false) {
  result total = {0, 0, 0, 0};
  for (int i = 0; i < N; i++) {
    result choose_neither = {0, 0, 0, 0};
    result choose_a = {PA[i] - AC, 1, 0, 0};
    result choose_b = {PB[i] - BC, 0, 1, 0};
    result choose_both = {PAB[i] - AC - BC, 1, 1, 0};
    result best = max({choose_neither, choose_a, choose_b, choose_both});
    if (best.score > 0 && best.score == choose_a.score &&
        best.score == choose_b.score) {
      best.a_count = best.b_count = 0;
      best.either = 1;
    }
    total += best;
  }
  if (final) assert(is_acceptable(total));
  total.score += A * AC + B * BC;
  return total;
}
result b_solve(long long AC, bool final = false) {
  long long low = 0, high = DENOM * DENOM;
  while (low < high) {
    long long mid = (low + high) / 2;
    if (evaluate(AC, mid).b_count <= B)
      high = mid;
    else
      low = mid + 1;
  }
  if (final) cerr << "Final b_cost: " << high << endl;
  return evaluate(AC, high, final);
}
result solve() {
  long long low = 0, high = DENOM * DENOM;
  while (low < high) {
    long long mid = (low + high) / 2;
    if (is_acceptable(b_solve(mid)))
      high = mid;
    else
      low = mid + 1;
  }
  cerr << "Final a_cost: " << high << endl;
  return b_solve(high, true);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(16);
  cin >> N >> A >> B;
  PA.resize(N);
  PB.resize(N);
  PAB.resize(N);
  for (auto &a : PA) {
    double x;
    cin >> x;
    a = DENOM * round(DENOM * x);
  }
  for (auto &b : PB) {
    double x;
    cin >> x;
    b = DENOM * round(DENOM * x);
  }
  for (int i = 0; i < N; i++)
    PAB[i] = PA[i] + PB[i] - (PA[i] / DENOM) * (PB[i] / DENOM);
  cout << (double)solve().score / (DENOM * DENOM) << '\n';
}