#include <bits/stdc++.h>
using namespace std;
#pragma GCC push_options
#pragma GCC optimize("unroll-loops")
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  return a.first - a.second > b.first - b.second;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, a, b;
  cin >> n >> a >> b;
  vector<pair<long long, long long> > v;
  for (int i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    v.emplace_back(make_pair(a, b));
  }
  sort((v).begin(), (v).end(), comp);
  long long sum = 0ll;
  for (int i = 0; i < n && i < b; i++) {
    sum += max(v[i].first, v[i].second);
  }
  for (int i = b; i < n; i++) {
    sum += v[i].second;
  }
  if (b == 0) {
    cout << sum << "\n";
    exit(0);
  }
  a = pow(2, a);
  long long ans = sum;
  for (int i = 0; i < n; i++) {
    if (i < b) {
      long long temp = v[i].first * a;
      long long ans1 =
          sum + max(temp, v[i].second) - max(v[i].first, v[i].second);
      ans = max(ans, ans1);
    } else {
      long long temp = v[i].first * a;
      long long ans1 = sum + max(temp, v[i].second) -
                       max(v[b - 1].first, v[b - 1].second) + v[b - 1].second -
                       v[i].second;
      ans = max(ans, ans1);
    }
  }
  cout << ans << "\n";
  return 0;
}
