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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.OptionalDouble;
import java.io.IOException;
import java.util.stream.DoubleStream;
import java.io.UncheckedIOException;
import java.math.BigDecimal;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 29);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            EGoshaIsHunting solver = new EGoshaIsHunting();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class EGoshaIsHunting {
        double ans;
        int n;
        int a;
        int b;
        int time1;
        int time2;
        double[] p;
        double[] u;

        public void solve(int testNumber, FastInput in, FastOutput out) {
            n = in.readInt();
            a = in.readInt();
            b = in.readInt();
            p = new double[n];
            u = new double[n];
            in.populate(p);
            in.populate(u);

            solve1();
            out.println(ans);
        }

        public void solve1() {
            double l = 0;
            double r = 1;
            for (int i = 0; i < 120; i++) {
                double m = (l + r) / 2;
                solve2(m);
                if (time1 > a) {
                    l = m;
                } else if (time1 < a) {
                    r = m;
                } else {
                    break;
                }
            }
        }

        public void solve2(double x) {
            double l = 0;
            double r = 1;
            for (int i = 0; i < 120; i++) {
                double m = (l + r) / 2;
                solve3(x, m);
                if (time2 > b) {
                    l = m;
                } else if (time2 < b) {
                    r = m;
                } else {
                    break;
                }
            }
        }

        public void solve3(double pCost, double uCost) {
            KahanSummation sum = new KahanSummation();
            time1 = 0;
            time2 = 0;
            for (int i = 0; i < n; i++) {
                double contrib = CompareUtils.maxOf(0, p[i] - pCost,
                        u[i] - uCost, p[i] + u[i] - p[i] * u[i] - pCost - uCost);
                if (contrib == p[i] - pCost) {
                    time1++;
                } else if (contrib == u[i] - uCost) {
                    time2++;
                } else if (contrib == p[i] + u[i] - p[i] * u[i] - pCost - uCost) {
                    time1++;
                    time2++;
                }
                sum.add(contrib);
            }
            ans = sum.sum() + pCost * a + uCost * b;
        }

    }

    static class KahanSummation {
        private double error;
        private double sum;

        public double sum() {
            return sum;
        }

        public void add(double x) {
            x = x - error;
            double t = sum + x;
            error = (t - sum) - x;
            sum = t;
        }

        public String toString() {
            return new BigDecimal(sum).toString();
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private StringBuilder cache = new StringBuilder(10 << 20);
        private final Writer os;

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(double c) {
            cache.append(new BigDecimal(c).toPlainString());
            return this;
        }

        public FastOutput println(double c) {
            return append(c).println();
        }

        public FastOutput println() {
            cache.append(System.lineSeparator());
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        public void populate(double[] data) {
            for (int i = 0; i < data.length; i++) {
                data[i] = readDouble();
            }
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

        public double readDouble() {
            boolean sign = true;
            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+';
                next = read();
            }

            double val = 0;
            while (next >= '0' && next <= '9') {
                val = val * 10 + next - '0';
                next = read();
            }
            if (next != '.') {
                return sign ? val : -val;
            }
            next = read();
            double radix = 1;
            while (next >= '0' && next <= '9') {
                val = val * 10 + next - '0';
                radix = radix * 10;
                next = read();
            }
            double result = val / radix;
            return sign ? result : -result;
        }

    }

    static class CompareUtils {
        private CompareUtils() {
        }

        public static double maxOf(double... a) {
            return Arrays.stream(a).max().orElse(0);
        }

    }
}