#include <bits/stdc++.h>
using namespace std;
typedef struct pantom {
  long long hp;
  long long atk;
} pan;
pan p[200005];
bool compare2(pan A, pan B) { return A.hp - A.atk > B.hp - B.atk; }
int main() {
  int N, a, b;
  int i;
  long long sum = 0, maxn = 0, ans = 0;
  scanf("%d%d%d", &N, &a, &b);
  for (i = 1; i <= N; i++) {
    scanf("%lld%lld", &(p + i)->hp, &(p + i)->atk);
  }
  sort(p + 1, p + N + 1, compare2);
  for (i = 1; i <= b; i++) {
    sum += max(p[i].atk, p[i].hp);
  }
  for (i = b + 1; i <= N; i++) {
    sum += p[i].atk;
  }
  ans = sum;
  if (b) {
    for (i = 1; i <= b; i++) {
      ans = max(ans, sum - max(p[i].atk, p[i].hp) + (p[i].hp << a));
    }
    sum = sum - max(p[b].atk, p[b].hp) + p[b].atk;
    for (i = b + 1; i <= N; i++) {
      ans = max(ans, sum - p[i].atk + (p[i].hp << a));
    }
  }
  printf("%lld", ans);
}
