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.
#include <bits/stdc++.h>
long long n, a, b;
struct node {
  long long hp, dmg;
  node() {}
  node(long long a, long long b) : hp(a), dmg(b) {}
};
signed main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  std::cin >> n >> a >> b;
  std::vector<node> v(n);
  long long x, y;
  for (long long i = 0; i < n; ++i) {
    std::cin >> x >> y;
    v[i] = node(x, y);
  }
  std::sort(v.begin(), v.end(), [](const node& x, const node& y) -> bool {
    return x.hp - x.dmg > y.hp - y.dmg;
  });
  std::vector<long long> swd;
  long long tmpb = b;
  long long sum = 0;
  for (long long i = 0; i < (long long)v.size(); ++i) {
    if (v[i].dmg < v[i].hp && tmpb > 0) {
      sum += v[i].hp;
      swd.push_back(i);
      tmpb--;
    } else {
      sum += v[i].dmg;
    }
  }
  if (b == 0) {
    std::cout << sum << std::endl;
    return 0;
  }
  long long last = -1;
  if (!swd.empty()) last = *swd.rbegin();
  std::sort(swd.begin(), swd.end());
  long long res = sum;
  for (long long i = 0; i < (long long)v.size(); ++i) {
    if (std::lower_bound(swd.begin(), swd.end(), i) != swd.end()) {
      long long reso = sum - v[i].hp + (v[i].hp << a);
      if (reso > res) {
        res = reso;
      }
    } else {
      long long reso = sum - v[i].dmg + (v[i].hp << a);
      if ((long long)swd.size() == b) {
        reso = reso - v[last].hp + v[last].dmg;
      }
      if (reso > res) {
        res = reso;
      }
    }
  }
  std::cout << res << std::endl;
}
