#include <bits/stdc++.h>
using namespace std;
int n, a, b;
struct st {
  long long hp, dmg;
  long long b, a;
} s[200005];
bool cmp(st a, st b) { return a.b > b.b; }
int main() {
  scanf("%d%d%d", &n, &a, &b);
  b = min(b, n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d%I64d", &s[i].hp, &s[i].dmg);
    s[i].b = max(0LL, s[i].hp - s[i].dmg);
    s[i].a = max(0LL, (s[i].hp << a) - s[i].dmg - s[i].b);
  }
  long long sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += s[i].dmg;
  }
  sort(s + 1, s + n + 1, cmp);
  long long sum2 = 0;
  for (int i = 1; i <= b; i++) {
    sum2 += s[i].b;
  }
  if (b == 0)
    printf("%I64d\n", sum);
  else {
    long long ans = 0;
    for (int i = 1; i <= n; i++) {
      long long x = 0;
      if (i <= b)
        x = sum2 + s[i].a;
      else
        x = sum2 + s[i].a + s[i].b - s[b].b;
      ans = max(ans, x);
    }
    printf("%I64d\n", sum + ans);
  }
  return 0;
}
