#include <bits/stdc++.h>
long long mod = 1000000007;
using namespace std;
long long n, a, b;
pair<long long, long long> C[200009];
inline long long getDiff(pair<long long, long long> x) {
  long long diff = x.first - x.second;
  if (diff < 0) diff = 0;
  return diff;
}
bool comp(pair<long long, long long> x, pair<long long, long long> y) {
  return getDiff(x) > getDiff(y);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    cin >> C[i].first >> C[i].second;
  }
  sort(C, C + n, comp);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (i < b)
      ans += max(C[i].first, C[i].second);
    else
      ans += C[i].second;
  }
  long long temp = ans;
  if (b) {
    for (int i = 0; i < n; i++) {
      long long usethis = temp;
      if (i < b)
        usethis -= max(C[i].first, C[i].second);
      else
        usethis -= (C[i].second + getDiff(C[b - 1]));
      usethis += (C[i].first << a);
      ans = max(ans, usethis);
    }
  }
  cout << ans << "\n";
  return 0;
}
