#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200005;
struct node {
  long long h, d, c;
} p[MAX_N];
bool cmp(node A, node B) { return A.c > B.c; }
int main() {
  int n, a, b;
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 1; i <= n; i++) {
    scanf("%lld%lld", &p[i].h, &p[i].d);
    p[i].c = p[i].h - p[i].d;
  }
  long long ans = 0;
  sort(p + 1, p + 1 + n, cmp);
  int left = b;
  for (int i = 1; i <= n; i++) {
    if (p[i].c > 0 && left)
      ans += p[i].h, left--;
    else
      ans += p[i].d;
  }
  if (a > 0 && b > 0) {
    long long t, pw = 2, res = ans;
    for (int i = 1; i < a; i++) pw *= 2;
    int use = b - left;
    for (int i = 1; i <= n; i++) {
      if (i <= use) {
        t = res - p[i].h + p[i].h * pw;
        if (ans < t) ans = t;
      } else {
        if (left) {
          t = res - p[i].d + p[i].h * pw;
          if (ans < t) ans = t;
        } else {
          t = res - p[use].h + p[use].d - p[i].d + p[i].h * pw;
          if (ans < t) ans = t;
        }
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
