#include <bits/stdc++.h>
const int N = 200010;
const int INF = 0x3f3f3f3f;
int t;
int n, a, b;
int cnt;
long long ans;
struct Measure {
  long long hp;
  long long dmg;
} c[N];
int main() {
  scanf("%d%d%d", &n, &a, &b);
  a = (1 << a);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &c[i].hp, &c[i].dmg);
  }
  std::sort(c + 1, c + n + 1,
            [](Measure& a, Measure& b) { return a.hp - a.dmg > b.hp - b.dmg; });
  cnt = n;
  for (int i = 1; i <= n; ++i) {
    if (c[i].hp <= c[i].dmg || i > b) {
      cnt = i - 1;
      break;
    }
  }
  for (int i = 1; i <= cnt; ++i) {
    ans += c[i].hp;
  }
  for (int i = cnt + 1; i <= n; ++i) {
    ans += c[i].dmg;
  }
  long long ans0 = ans;
  if (a > 1 && b > 0) {
    for (int i = 1; i <= n; ++i) {
      long long tmp_ans = ans0 - (i <= cnt ? c[i].hp : c[i].dmg);
      if (i > cnt && cnt == b) {
        tmp_ans += (c[cnt].dmg - c[cnt].hp);
      }
      tmp_ans += (c[i].hp * a);
      ans = std::max(ans, tmp_ans);
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
