#include <bits/stdc++.h>
using namespace std;
const int MN = 200300;
pair<long long, long long> v[MN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, a, b;
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    v[i] = {y - x, x};
  }
  sort(v, v + n);
  b = min(b, n);
  for (int i = 0; i < n; i++) {
    v[i] = {v[i].second, v[i].first + v[i].second};
  }
  long long tot = 0, sm = 0;
  long long va = 0;
  for (int i = 0; i < n; i++) {
    long long t = v[i].second;
    if (i < b) {
      t = max(v[i].first, t);
      sm += t;
      va = v[i].second - v[i].first;
    }
    tot += t;
  }
  long long res = tot;
  if (b == 0) {
    cout << res << '\n';
    return 0;
  }
  long long ml = 1LL << a;
  for (int i = 0; i < b; i++) {
    long long val = tot;
    val -= max(v[i].first, v[i].second);
    val += max(v[i].first * ml, v[i].second);
    res = max(res, val);
  }
  for (int i = b; i < n; i++) {
    long long val = tot;
    val += min(va, 0LL);
    val -= v[i].second;
    val += max(v[i].first * ml, v[i].second);
    res = max(res, val);
  }
  cout << res << '\n';
}
