#include <bits/stdc++.h>
using namespace std;
vector<array<long long, 3>> a;
int n;
int main() {
  static long long n, x, y;
  scanf("%lld%lld%lld", &n, &x, &y);
  y = min(y, n);
  for (int i = 0; i < n; i++) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    a.push_back({max(x - y, 0ll), x, y});
  }
  sort(a.rbegin(), a.rend());
  long long sum = 0;
  for (int i = 0; i < y; i++) sum = sum + a[i][2] + a[i][0];
  for (int i = y; i < n; i++) sum = sum + a[i][2];
  if (y == 0) {
    printf("%lld\n", sum);
    exit(0);
  }
  long long ans = sum;
  for (int i = 0; i < y; i++)
    ans = max(ans, sum - a[i][0] - a[i][2] + max(a[i][1] << x, a[i][2]));
  for (int i = y; i < n; i++)
    ans = max(ans, sum - a[y - 1][0] - a[i][2] + max(a[i][1] << x, a[i][2]));
  printf("%lld\n", ans);
  return 0;
}
