#include <bits/stdc++.h>
using namespace std;
int N, A, B;
pair<long long, long long> val[200005];
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  return a.first - a.second > b.first - b.second;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> N >> A >> B;
  for (int i = 0; i < N; i++) cin >> val[i].first >> val[i].second;
  sort(val, val + N, cmp);
  long long cur = 0, rem = 0, cnt = 0;
  for (int i = 0; i < N; i++) {
    if (i < B && val[i].first > val[i].second) {
      cur += val[i].first;
      rem = val[i].first - val[i].second;
      cnt++;
    } else
      cur += val[i].second;
  }
  long long ans = cur;
  if (cnt < B) rem = 0;
  if (B > 0) {
    for (int i = 0; i < N; i++) {
      if (i < B && val[i].first > val[i].second)
        ans = max(ans, cur - val[i].first + val[i].first * (1 << A));
      else
        ans = max(ans, cur - val[i].second - rem + val[i].first * (1 << A));
    }
  }
  cout << ans << "\n";
  return 0;
}
