#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 5;
int n, a, b;
pair<int, int> e[MAX];
long long s1[MAX], s2[MAX];
int main() {
  scanf("%d%d%d", &n, &a, &b);
  long long tot = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &e[i].first, &e[i].second);
    tot += e[i].second;
  }
  if (b == 0) {
    printf("%lld\n", tot);
    return 0;
  }
  long long pw = 1;
  for (int i = 1; i <= a; i++) pw = pw * 2LL;
  vector<pair<int, int> > v, w;
  for (int i = 1; i <= n; i++) {
    long long res = pw * e[i].first;
    if (res > e[i].second) v.push_back({e[i].first - e[i].second, e[i].second});
  }
  if (!v.empty()) {
    sort(v.begin(), v.end());
    long long ans = 0;
    for (int i = (int)v.size() - 1; i >= 0; i--) {
      if (i < (int)v.size() - 1) {
        s1[i] = s1[i + 1];
        s2[i] = s2[i + 1];
      }
      s1[i] += v[i].first + v[i].second;
      s2[i] += v[i].second;
    }
    int p = max(0, (int)v.size() - (b - 1));
    while (p < (int)v.size() && v[p].first <= 0) {
      p++;
    }
    for (int i = 0; i < (int)v.size(); i++) {
      long long res = pw * (v[i].first + v[i].second);
      long long tmp_tot = tot;
      if (p > i) {
        tmp_tot -= v[i].second;
        ans = max(ans, res + tmp_tot - s2[p] + s1[p]);
      } else {
        long long val =
            res + s1[p] - (v[i].first + v[i].second) + tmp_tot - s2[p];
        if (p > 0 && v[p - 1].first > 0) {
          val += v[p - 1].first + v[p - 1].second;
          val -= v[p - 1].second;
        }
        ans = max(ans, val);
      }
    }
    printf("%lld\n", ans);
  } else
    printf("%lld\n", tot);
  return 0;
}
