#include <bits/stdc++.h>
using namespace std;
struct Creature {
  int hp, dmg;
  bool operator<(const Creature &rhs) const {
    return (hp - dmg) > (rhs.hp - rhs.dmg);
  }
};
long long solve(vector<Creature> &creatures, int n, int a, int b) {
  sort(creatures.begin(), creatures.end());
  long long base = 0, bbase = 0;
  for (int i = 0; i < n; i++) {
    if (i < b) {
      base += max(creatures[i].hp, creatures[i].dmg);
    } else {
      base += creatures[i].dmg;
    }
    if (i < b - 1) {
      bbase += max(creatures[i].hp, creatures[i].dmg);
    } else {
      bbase += creatures[i].dmg;
    }
  }
  if (b == 0) {
    return base;
  }
  long long ret = base;
  long long mul = pow(2, a);
  for (int i = 0; i < n; i++) {
    long long current;
    if (i < b) {
      current = base - max(creatures[i].hp, creatures[i].dmg);
    } else {
      current = bbase - creatures[i].dmg;
    }
    current += creatures[i].hp * mul;
    ret = max(current, ret);
  }
  return ret;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, a, b;
  cin >> n >> a >> b;
  vector<Creature> creatures(n);
  for (int i = 0; i < n; i++) {
    int hp, dmg;
    cin >> hp >> dmg;
    creatures[i] = {hp, dmg};
  }
  cout << solve(creatures, n, a, b) << '\n';
  return 0;
}
