#include <bits/stdc++.h>
const int N = 2e5 + 5;
long long hp[N], dmg[N], c[N];
int a, b, n, p[N];
bool cmp(int x, int y) { return hp[x] - dmg[x] > hp[y] - dmg[y]; }
int main() {
  scanf("%d%d%d", &n, &a, &b);
  long long ans = 0;
  for (int i = 1; i <= n; ++i) scanf("%lld%lld", hp + i, dmg + i), p[i] = i;
  long long now = 1LL << a;
  std::sort(p + 1, p + 1 + n, cmp);
  for (int i = 1; i <= n; i++)
    if (i <= b)
      ans += std::max(hp[p[i]], dmg[p[i]]);
    else
      ans += dmg[p[i]];
  long long sum = ans;
  for (int i = 1; i <= n; i++) {
    long long res = sum;
    int j = p[i];
    if (i <= b) {
      res -= std::max(hp[j], dmg[j]);
      res += std::max(hp[j] * now, dmg[j]);
      ans = std::max(ans, res);
    } else {
      res -= std::max(hp[p[b]], dmg[p[b]]) - dmg[p[b]] + dmg[j];
      res += std::max(dmg[j], hp[j] * now);
      ans = std::max(ans, res);
    }
  }
  if (!b) ans = sum;
  printf("%lld\n", ans);
  return 0;
}
