#include <bits/stdc++.h>
using namespace std;
long long n, a, b;
pair<long long, long long> v[200100];
bool cmp(const pair<long long, long long>& x,
         const pair<long long, long long>& y) {
  return x.first - x.second > y.first - y.second;
}
void solve() {
  sort(v, v + n, cmp);
  long long res = 0, sum = 0;
  for (int i = 0; i < n; i++)
    sum += (i < b && v[i].first > v[i].second ? v[i].first : v[i].second);
  res = sum;
  if (b > 0) {
    for (int i = 0; i < n; i++) {
      if (i < b)
        res = max(res, sum - max(v[i].first, v[i].second) + (v[i].first << a));
      else
        res =
            max(res, sum - v[i].second - max(v[b - 1].first, v[b - 1].second) +
                         v[b - 1].second + (v[i].first << a));
    }
  }
  cout << res << endl;
}
int main() {
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
  }
  solve();
  return 0;
}
