#include <bits/stdc++.h>
using namespace std;
long long len = (2 * 1e+5) + 15;
vector<pair<long long, long long>> c(len);
bool comp(long long i, long long j) {
  if (c[i].first - c[i].second != c[j].first - c[j].second) {
    return c[i].first - c[i].second > c[j].first - c[j].second;
  } else
    return i < j;
}
long long dif(long long i) { return max(c[i].first, c[i].second); }
int main() {
  long long n, i, sum = 0, a, b, itg = 0, mult;
  cin >> n >> a >> b;
  b = min(b, n);
  vector<long long> id(n);
  for (i = 0; i < n; i++) {
    id[i] = i;
  }
  for (i = 0; i < n; i++) {
    cin >> c[i].first >> c[i].second;
  }
  mult = pow(2, a);
  sort(id.begin(), id.end(), comp);
  sum = 0;
  for (i = 0; i < n; i++) {
    if (i < b) {
      sum += dif(id[i]);
    } else {
      sum += c[id[i]].second;
    }
  }
  if (b == 0) {
    cout << sum;
    return 0;
  }
  itg = sum;
  for (int i = 0; i < n; i++) {
    long long chg = sum;
    if (i < b) {
      chg -= dif(id[i]);
      chg += c[id[i]].first * mult;
      itg = max(itg, chg);
    } else {
      chg -= c[id[i]].second;
      chg += c[id[i]].first * mult;
      int num = id[b - 1];
      chg -= dif(num);
      chg += c[num].second;
      itg = max(itg, chg);
    }
  }
  cout << itg;
  return 0;
}
