#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int n, a, b, A[maxn];
struct node {
  long long h, d;
  friend bool operator<(const node& a, const node& b) {
    return a.h - a.d > b.h - b.d;
  }
} B[maxn];
int main() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 0; i < n; i++) scanf("%I64d%I64d", &B[i].h, &B[i].d);
  sort(B, B + n);
  memset(A, 0, sizeof(A));
  long long sum = 0, u = 0, del = 0x3f3f3f3f;
  for (int i = 0; i < n; i++) {
    if (B[i].h > B[i].d && u < b) {
      u++;
      A[i] = 1;
      sum += B[i].h;
      del = min(del, B[i].h - B[i].d);
    } else {
      A[i] = 0;
      sum += B[i].d;
    }
  }
  if (u == 0) del = 0;
  long long ans = sum;
  for (int i = 0; i < n; i++) {
    if (b == 0) break;
    long long tmp = B[i].h << a;
    if (A[i] == 1) {
      ans = max(ans, sum + tmp - B[i].h);
    } else {
      if (u == b) tmp -= del;
      ans = max(ans, sum + tmp - B[i].d);
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
