#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 5;
pair<long long, long long> ani[maxn];
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  return a.first - a.second > b.first - b.second;
}
signed main() {
  long long n, a, b;
  cin >> n >> a >> b;
  for (long long i = 1; i <= n; i++) cin >> ani[i].first >> ani[i].second;
  sort(ani + 1, ani + 1 + n, cmp);
  long long las = min(n, b), ans = 0, tmp = 0;
  if (!b) {
    for (long long i = 1; i <= n; i++) ans += ani[i].second;
    cout << ans << endl;
    return 0;
  }
  if (ani[las].first <= ani[las].second) {
    for (long long i = 1; i <= n; i++) ans += max(ani[i].first, ani[i].second);
    for (long long i = 1; i <= n; i++)
      tmp = max(tmp, (ani[i].first << a) - max(ani[i].first, ani[i].second));
    ans += tmp;
    cout << ans << endl;
    return 0;
  }
  for (long long i = 1; i <= las; i++) ans += ani[i].first;
  for (long long i = las + 1; i <= n; i++) ans += ani[i].second;
  for (long long i = 1; i <= las; i++)
    tmp = max(tmp, (ani[i].first << a) - ani[i].first);
  for (long long i = las + 1; i <= n; i++)
    tmp = max(tmp, (ani[i].first << a) - ani[i].second -
                       (ani[las].first - ani[las].second));
  ans += tmp;
  cout << ans << endl;
  return 0;
}
