#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;
}
