#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const double esp = 1e-12;
const int ff = 0x3f3f3f3f;
map<int, int>::iterator it;
struct node {
  long long h, d;
  int mk;
} p[maxn];
long long n, a, b;
bool cmp(node x, node y) { return x.h - x.d < y.h - y.d; }
long long quick_pow(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans *= x;
    x *= x;
    y >>= 1;
  }
  return ans;
}
int main() {
  memset(p, 0, sizeof(p));
  cin >> n >> a >> b;
  for (int i = 1; i <= n; i++) scanf("%lld %lld", &p[i].h, &p[i].d);
  sort(p + 1, p + n + 1, cmp);
  int last = n + 1;
  for (int i = n; i >= 1; i--) {
    if (p[i].h - p[i].d > 0 && b > 0)
      p[i].mk = 1, b--;
    else
      break;
    last--;
  }
  long long sum = 0;
  for (int i = 1; i <= n; i++)
    if (p[i].mk)
      sum += p[i].h;
    else
      sum += p[i].d;
  long long ans = sum;
  for (int i = 1; i <= n; i++) {
    long long tmp = p[i].h * quick_pow(2, a);
    long long d = 0;
    if (p[i].mk)
      d = sum - p[i].h + tmp;
    else if (tmp > p[i].d) {
      if (b > 0)
        d = sum - p[i].d + tmp;
      else if (last <= n)
        d = sum - p[last].h + p[last].d - p[i].d + tmp;
    }
    ans = max(ans, d);
  }
  cout << ans << endl;
  return 0;
}
