#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
int n, a, b;
long long hp[maxn], dmg[maxn];
int id[maxn];
long long kq;
bool cmp(int i, int j) { return hp[i] - dmg[i] > hp[j] - dmg[j]; }
long long max(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
int main() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 1; i <= n; i++) cin >> hp[i] >> dmg[i];
  for (int i = 1; i <= n; i++) id[i] = i;
  sort(id + 1, id + n + 1, cmp);
  long long sum = 0;
  for (int i = 1; i <= n; i++)
    if (i <= b) {
      if (hp[id[i]] > dmg[id[i]])
        sum = sum + hp[id[i]];
      else
        sum = sum + dmg[id[i]];
    } else
      sum = sum + dmg[id[i]];
  kq = sum;
  for (int i = 1; i <= b; i++) {
    long long tmp = hp[id[i]] << a;
    long long tsum = sum;
    if (hp[id[i]] > dmg[id[i]])
      tsum = tsum - hp[id[i]] + tmp;
    else
      tsum = tsum - dmg[id[i]] + tmp;
    kq = max(kq, tsum);
  }
  if (b > 0)
    for (int i = b + 1; i <= n; i++) {
      long long tmp = hp[id[i]] << a;
      long long tsum = sum;
      tsum = tsum - dmg[id[i]] + tmp;
      if (hp[id[b]] > dmg[id[b]]) tsum = tsum - hp[id[b]] + dmg[id[b]];
      kq = max(kq, tsum);
    }
  cout << kq;
}
