#include <bits/stdc++.h>
using namespace std;
istream& in = cin;
int n, a, b;
pair<long long, long long> d[200010];
bool mark[200010];
void input() {
  in >> n >> a >> b;
  for (int i = 1; i <= n; ++i) in >> d[i].first >> d[i].second;
}
int main() {
  int TEST_CASE = 1;
  while (TEST_CASE-- > 0) {
    input();
    if (b == 0) {
      long long sum = 0;
      for (int i = 1; i <= n; ++i) {
        sum += d[i].second;
      }
      cout << sum << endl;
      return 0;
    }
    long long mul = 1;
    for (int i = 0; i < a; ++i) mul *= 2;
    vector<pair<long long, long long> > all;
    for (int i = 1; i <= n; ++i) {
      if (d[i].first > d[i].second) {
        all.push_back(make_pair(d[i].second - d[i].first, i));
      }
    }
    sort(all.begin(), all.end());
    long long sum = 0;
    bool has = 0;
    if (b > all.size()) {
      has = 1;
    }
    for (int i = 0; i < b && i < all.size(); ++i) {
      mark[all[i].second] = 1;
      sum -= all[i].first;
    }
    long long useless = 0;
    if (has) {
      if (!all.empty()) {
        useless = -all.back().first;
      }
    } else {
      useless = -all[b - 1].first;
    }
    long long ckk = 0;
    for (int i = 1; i <= n; ++i) {
      if (mark[i]) {
        ckk += d[i].first;
      } else {
        ckk += d[i].second;
      }
    }
    long long ans = ckk;
    for (int i = 1; i <= n; ++i) {
      long long val = d[i].first * mul;
      long long tmp;
      if (mark[i]) {
        tmp = ckk - d[i].first + val;
      } else if (has) {
        tmp = ckk - d[i].second + val;
      } else {
        tmp = ckk - d[i].second + val - useless;
      }
      ans = max(ans, tmp);
    }
    cout << ans << endl;
  }
  return 0;
}
