#include <bits/stdc++.h>
using namespace std;
long long n, a, b, sum[200005], sm[200005];
struct node {
  long long x, y, z;
} val[200005];
bool comp(node a, node b) { return a.z > b.z; }
int main(void) {
  long long ans = 0;
  scanf("%lld%lld%lld", &n, &a, &b);
  b = min(b, n);
  for (int i = 1; i <= n; i++)
    scanf("%lld%lld", &val[i].x, &val[i].y), val[i].z = val[i].x - val[i].y;
  sort(val + 1, val + n + 1, comp);
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + max(val[i].x, val[i].y);
    sm[i] = sm[i - 1] + val[i].y;
  }
  ans += sum[b] + sm[n] - sm[b];
  if (b == 0) {
    printf("%lld\n", sm[n]);
    return 0;
  }
  if (a == 0) {
    printf("%lld\n", ans);
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    int num = 0;
    long long t = val[i].x;
    for (int j = 1; j <= a; j++) t *= 2ll;
    if (i <= b - 1)
      t = t - max(val[i].x, val[i].y), t += sum[b], t += sm[n] - sm[b];
    else
      t += sum[b - 1], t += sm[n] - sm[b - 1] - val[i].y;
    ans = max(ans, t);
  }
  printf("%lld\n", ans);
  return 0;
}
