Recently Max has got himself into popular CCG "BrainStone". As "BrainStone" is a pretty intellectual game, Max has to solve numerous hard problems during the gameplay. Here is one of them:

Max owns n creatures, i-th of them can be described with two numbers — its health hpi and its damage dmgi. Max also has two types of spells in stock:

  1. Doubles health of the creature (hpi := hpi·2); 
  2. Assigns value of health of the creature to its damage (dmgi := hpi). 



Spell of first type can be used no more than a times in total, of the second type — no more than b times in total. Spell can be used on a certain creature multiple times. Spells can be used in arbitrary order. It isn't necessary to use all the spells.

Max is really busy preparing for his final exams, so he asks you to determine what is the maximal total damage of all creatures he can achieve if he uses spells in most optimal way.

Input

The first line contains three integers n, a, b (1 ≤ n ≤ 2·105, 0 ≤ a ≤ 20, 0 ≤ b ≤ 2·105) — the number of creatures, spells of the first type and spells of the second type, respectively.

The i-th of the next n lines contain two number hpi and dmgi (1 ≤ hpi, dmgi ≤ 109) — description of the i-th creature.

Output

Print single integer — maximum total damage creatures can deal.

Examples

Input

2 1 1
10 15
6 1


Output

27


Input

3 0 3
10 8
7 11
5 2


Output

26

Note

In the first example Max should use the spell of the first type on the second creature, then the spell of the second type on the same creature. Then total damage will be equal to 15 + 6·2 = 27.

In the second example Max should use the spell of the second type on the first creature, then the spell of the second type on the third creature. Total damage will be equal to 10 + 11 + 5 = 26.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author prakharjain
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        _976E solver = new _976E();
        solver.solve(1, in, out);
        out.close();
    }

    static class _976E {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            int a = in.nextInt();

            int b = in.nextInt();

            cre[] cs = new cre[n];

            for (int i = 0; i < n; i++) {
                cs[i] = new cre(in.nextInt(), in.nextInt());
            }

            Arrays.sort(cs, (c1, c2) -> (int) Math.signum(c2.diff - c1.diff));

            long[] d = new long[n];

            for (int i = 0; i < n; i++) {
                d[i] = Math.max(0, cs[i].diff);
            }

            SegmentTree st = new SegmentTree(n);
            st.build(0, d, 0, n - 1);

            long ans = 0;
            long pre = 0;

            for (int i = 0; i < n; i++) {
                pre += cs[i].d;
            }

            if (b == 0) {
                out.println(pre);
                return;
            }

            for (int i = 0; i < n; i++) {
                long ch = cs[i].h;

                for (int j = 0; j < a; j++) {
                    ch *= 2;
                }

                long ca = pre;
                ca += Math.max(0, ch - cs[i].d);

                if (i >= b - 1) {
                    ca += st.query(0, 0, n - 1, 0, b - 2);
                } else {
                    ca += st.query(0, 0, n - 1, 0, i - 1);
                    ca += st.query(0, 0, n - 1, i + 1, Math.min(b - 1, n - 1));
                }

                ans = Math.max(ans, ca);
            }

            out.println(ans);

        }

        public class SegmentTree {
            long[] st;
            int n;

            public SegmentTree(int n) {
                st = new long[4 * n];
                this.n = n;
            }

            void build(int i, long[] a, int r1, int r2) {
                if (r1 == r2) {
                    st[i] = a[r1];
                } else {
                    build(i * 2 + 1, a, r1, (r1 + r2) / 2);
                    build(i * 2 + 2, a, (r1 + r2) / 2 + 1, r2);

                    st[i] = st[i * 2 + 1] + st[i * 2 + 2];
                }
            }

            long query(int i, int ra, int rb, int r1, int r2) {
                if (ra > r2 || rb < r1) {
                    return 0;
                }

                if (ra >= r1 && rb <= r2) {
                    return st[i];
                }

                long p1 = query(i * 2 + 1, ra, (ra + rb) / 2, r1, r2);
                long p2 = query(i * 2 + 2, (ra + rb) / 2 + 1, rb, r1, r2);

                return p1 + p2;
            }

        }

        class cre {
            long h;
            long d;
            long diff;

            public cre(long h, long d) {
                this.h = h;
                this.d = d;
                this.diff = Math.max(0, h - d);
            }

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(long i) {
            writer.println(i);
        }

    }
}

