#include <bits/stdc++.h>
using namespace std;
int n, a, b;
long long ans, e = 1;
pair<long long, long long> m[200005];
int main() {
  cin >> n >> a >> b;
  while (a) {
    e *= 2;
    a--;
  }
  for (int i = 0; i < n; i++) cin >> m[i].first >> m[i].second;
  b = min(n, b);
  sort(m, m + n,
       [](pair<long long, long long> a, pair<long long, long long> b) {
         return a.first - a.second > b.first - b.second;
       });
  for (int i = 0; i < n; i++) {
    if (i < b)
      ans += max(m[i].first, m[i].second);
    else
      ans += m[i].second;
  }
  long long tans, ANS = ans;
  for (int i = 0; i < n; i++) {
    if (i < b)
      tans = ans + e * m[i].first - max(m[i].first, m[i].second);
    else if (b)
      tans = ans + e * m[i].first - m[i].second -
             max(m[b - 1].first, m[b - 1].second) +
             min(m[b - 1].first, m[b - 1].second);
    ANS = max(tans, ANS);
  }
  cout << ANS << endl;
  return 0;
}
