#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MAXN = 2e5 + 5;
const long long LINF = 1e18;
const double pi = 3.1415926535;
const double EPS = 1e-9;
template <class T>
using MinPQ = priority_queue<T, vector<T>, greater<T>>;
template <class T>
using MaxPQ = priority_queue<T>;
int n, a, b;
long long hp[MAXN], dmg[MAXN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> a >> b;
  b = min(b, n);
  for (int i = 0; i < n; i++) cin >> hp[i] >> dmg[i];
  auto comp = [](int i, int j) -> bool {
    if (hp[i] - dmg[i] != hp[j] - dmg[j])
      return hp[i] - dmg[i] > hp[j] - dmg[j];
    return i < j;
  };
  vector<int> v;
  for (int i = 0; i < n; i++) v.push_back(i);
  sort(v.begin(), v.end(), comp);
  long long ans = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    int cur = v[i];
    if (i < b)
      sum += max(dmg[cur], hp[cur]);
    else
      sum += dmg[cur];
  }
  ans = sum;
  if (b == 0) return printf("%lld\n", ans), 0;
  long long x = (1 << a);
  for (int i = 0; i < n; i++) {
    int cur = v[i];
    long long nans = sum;
    if (i < b) {
      nans -= max(dmg[cur], hp[cur]);
      nans += hp[cur] * x;
      ans = max(ans, nans);
    } else {
      nans -= dmg[cur];
      nans += hp[cur] * x;
      int cur2 = v[b - 1];
      nans -= max(dmg[cur2], hp[cur2]);
      nans += dmg[cur2];
      ans = max(ans, nans);
    }
  }
  printf("%lld\n", ans);
  return 0;
}
