#include <bits/stdc++.h>
using namespace std;
bool compare(pair<long long, long long> &f, pair<long long, long long> &s) {
  return f.first - f.second > s.first - s.second;
}
signed main() {
  long long n, a, b;
  cin >> n >> a >> b;
  vector<pair<long long, long long> > v(n);
  for (long long i = 0; i < n; ++i) {
    scanf("%I64d %I64d", &v[i].first, &v[i].second);
  }
  if (b == 0) {
    long long ans = 0;
    for (auto it : v) {
      ans += it.second;
    }
    cout << ans << endl;
    return 0;
  }
  --b;
  sort(v.begin(), v.end(), compare);
  long long sum = 0;
  b = min((long long)v.size() - 1, b);
  for (long long i = 0; i < n; ++i) {
    if (i < b)
      sum += max(v[i].first, v[i].second);
    else
      sum += v[i].second;
  }
  long long ans = sum;
  ans = max(ans, sum + (v[b].first - v[b].second));
  for (long long i = 0; i < n; ++i) {
    if (i < b) {
      long long cursum = sum - max(v[i].first, v[i].second);
      if (v[b].first > v[b].second) {
        cursum += v[b].first - v[b].second;
      }
      cursum += (1 << a) * v[i].first;
      ans = max(ans, cursum);
    } else {
      long long cursum = sum - v[i].second;
      cursum += (1 << a) * v[i].first;
      ans = max(ans, cursum);
    }
  }
  cout << ans << endl;
}
