#include <bits/stdc++.h>
using namespace std;
struct info {
  int hp, dmg, w;
} A[200010];
int n, a, b;
long long sum, Ans;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int main() {
  n = read(), a = read(), b = min(read(), n);
  for (int i = 1; i <= n; ++i)
    A[i].hp = read(), A[i].dmg = read(), A[i].w = max(0, A[i].hp - A[i].dmg);
  sort(A + 1, A + n + 1, [](info a, info b) { return a.w > b.w; });
  for (int i = 1; i <= n; ++i)
    sum += ((i <= b) ? max(A[i].hp, A[i].dmg) : A[i].dmg);
  if (b == 0) {
    printf("%lld\n", sum);
    return 0;
  }
  Ans = sum;
  for (int i = 1; i <= n; ++i) {
    long long tmp = sum;
    if (i <= b) {
      tmp -= max(A[i].hp, A[i].dmg);
      tmp += A[i].hp * (1ll << a);
      Ans = max(Ans, tmp);
    } else {
      tmp -= A[i].dmg;
      tmp += A[i].hp * (1ll << a);
      tmp -= max(A[b].hp, A[b].dmg);
      tmp += A[b].dmg;
      Ans = max(Ans, tmp);
    }
  }
  printf("%lld\n", Ans);
  return 0;
}
