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.BufferedReader;
// import java.io.FileInputStream;
// import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;

import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.util.Arrays.sort;

public class Main {
    FastScanner in;
    PrintWriter out;

    private void solve() throws IOException {
        int n = in.nextInt(), a = in.nextInt(), b = min(in.nextInt(), n);

        Man[] man = new Man[n];
        long sum = 0, add = 0;
        for (int i = 0; i < n; i++) {
            man[i] = new Man(in.nextLong(), in.nextLong());
            sum += man[i].deg;
        }

        sort(man, Comparator.comparingLong(o -> -o.diff));

        for (int i = 0; i < b; i++)
            add += man[i].diff;

        long maxAdd = add;
        for (int i = 0; b > 0 && i < n; i++) {
            long newDiff = max((man[i].hp << a) - man[i].deg, 0);
            maxAdd = max(maxAdd, add - man[min(i, b - 1)].diff + newDiff);
        }
        out.println(sum + maxAdd);
    }

    class Man {
        long hp, deg, diff;

        Man(long hp, long deg) {
            this.hp = hp;
            this.deg = deg;
            diff = max(hp - deg, 0);
        }
    }

    private void solveE() throws IOException {
        int n = in.nextInt(), a = in.nextInt(), b = min(in.nextInt(), n);

        long[] hp = new long[n];
        long[] dmg = new long[n];

        for (int i = 0; i < n; i++) {
            hp[i] = in.nextLong();
            dmg[i] = in.nextLong();
        }

        long sum = 0;
        if (b > 0) {

            if (a > 0) {
                long mult = 1;
                for (int i = 0; i < a; i++) {
                    mult *= 2;
                }

                long max = 0;
                int id = -1;
                for (int i = 0; i < n; i++) {
                    if (hp[i] * mult - dmg[i] > max) {
                        max = hp[i] * mult - dmg[i];
                        id = i;
                    }
                }
                if (id != -1) {
                    hp[id] *= mult;
                    dmg[id] = hp[id];
                    b--;
                }
            }

            for (int i = 0; i < n; i++) {
                sum += dmg[i];
                dmg[i] = hp[i] - dmg[i];
            }

            shuffle(dmg);
            sort(dmg);
            reverse(dmg);

            for (int i = 0; i < min(n, b); i++) {
                if (dmg[i] > 0) {
                    sum += dmg[i];
                } else {
                    break;
                }
            }
        } else {
            for (int i = 0; i < n; i++) {
                sum += dmg[i];
            }
        }

        out.println(sum);
    }

    void shuffle(long[] a) {
        long b;
        Random r = new Random();
        for (int i = a.length - 1, j; i > 0; i--) {
            j = r.nextInt(i + 1);
            b = a[j];
            a[j] = a[i];
            a[i] = b;
        }
    }

    void reverse(long[] a) {
        long b;
        for (int i = 0, j = a.length - 1; i < j; i++, j--) {
            b = a[i];
            a[i] = a[j];
            a[j] = b;
        }
    }

    class FastScanner {
        StringTokenizer st;
        BufferedReader br;

        FastScanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        boolean hasNext() throws IOException {
            return br.ready() || (st != null && st.hasMoreTokens());
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next().replace(',', '.'));
        }

        String nextLine() throws IOException {
            return br.readLine();
        }

        boolean hasNextLine() throws IOException {
            return br.ready();
        }

    }

    private void run() throws IOException {
        in = new FastScanner(System.in); // new FastScanner(new FileInputStream(".in"));
        out = new PrintWriter(System.out); // new PrintWriter(new FileOutputStream(".out"));

        solve();

        out.flush();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }
}
