#include <bits/stdc++.h>
using namespace std;
struct cre {
  int h, d;
} an[200005];
int n, i, a, b, mi[22], pos;
long long ans = 0, sum[200005], uu;
bool cmp(cre a, cre b) { return a.h - a.d > b.h - b.d; }
int main() {
  scanf("%d%d%d", &n, &a, &b);
  mi[0] = 1;
  uu = 0;
  for (i = 1; i <= a; i++) mi[i] = mi[i - 1] * 2;
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &an[i].h, &an[i].d);
    uu += an[i].d;
  }
  sort(an + 1, an + n + 1, cmp);
  for (i = 1; an[i].h - an[i].d >= 0 && i <= n; i++)
    ;
  pos = min(b, i - 1);
  sum[0] = 0;
  if (b == 0) {
    printf("%I64d\n", uu);
    return 0;
  }
  for (i = 1; i <= n; i++) sum[i] = sum[i - 1] + an[i].h - an[i].d;
  for (i = 1; i <= n; i++) {
    if (i <= pos) {
      ans = max(ans, (long long){uu + sum[pos] - (an[i].h - an[i].d) - an[i].d +
                                 1LL * an[i].h * mi[a]});
    } else {
      ans = max(ans, (long long){uu + sum[min(pos, b - 1)] - an[i].d +
                                 1LL * an[i].h * mi[a]});
    }
  }
  ans = max(ans, uu);
  printf("%I64d\n", ans);
  return 0;
}
