#include <bits/stdc++.h>
using namespace std;
struct node {
  long long hp, dmg, y;
} c[200010];
int n, a, b;
bool cmp(node j, node k) { return j.y > k.y; }
int main(int argc, char *argv[]) {
  while (scanf("%d%d%d", &n, &a, &b) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%I64d%I64d", &c[i].hp, &c[i].dmg);
      c[i].y = c[i].hp - c[i].dmg;
    }
    sort(c + 1, c + n + 1, cmp);
    long long ans = 0;
    int left = b, f = 0;
    for (int i = 1; i <= n; i++) {
      if (c[i].y > 0 && left) {
        ans += c[i].hp, left--, f = i;
      } else
        ans += c[i].dmg;
    }
    if (a > 0 && b > 0) {
      long long sum = ans, t, pw = 1;
      for (int i = 1; i <= a; i++) pw *= 2;
      for (int i = 1; i <= n; i++) {
        if (i <= f) {
          t = sum + c[i].hp * pw - c[i].hp;
          if (ans < t) ans = t;
        } else {
          if (left) {
            t = sum + c[i].hp * pw - c[i].dmg;
            if (ans < t) ans = t;
          } else {
            t = sum - c[f].hp + c[f].dmg + c[i].hp * pw - c[i].dmg;
            if (ans < t) ans = t;
          }
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
