#include <bits/stdc++.h>
using namespace std;
inline void prep() {
  cin.tie(0);
  cin.sync_with_stdio(0);
}
const int mod = (int)1e9 + 7;
const int MX = (int)1e6 + 1;
int main() {
  prep();
  int n, a, b;
  cin >> n >> a >> b;
  int hp[n], dg[n], io[n];
  for (int i = 0; i < n; ++i) {
    cin >> hp[i] >> dg[i];
  }
  iota(io, io + n, 0);
  sort(io, io + n, [&](int x, int y) {
    int fs = (hp[x] - dg[x]);
    int sc = (hp[y] - dg[y]);
    return fs > sc;
  });
  long long res = 0;
  for (int i = 0; i < n; ++i) {
    int idx = io[i];
    if (i < b)
      res += max(hp[idx], dg[idx]);
    else
      res += dg[idx];
  }
  long long ans = res;
  for (int i = 0; i < n; ++i) {
    int idx = io[i];
    long long afterEffect = hp[idx] * (1ll << a);
    int Alreadychoosen = 0;
    long long cur = 0;
    int del = 0;
    if (b) {
      if (i < b)
        Alreadychoosen = max(hp[idx], dg[idx]);
      else {
        Alreadychoosen = dg[idx];
        int last_bst = max(hp[io[b - 1]], dg[io[b - 1]]);
        if (last_bst == hp[io[b - 1]]) del = last_bst - dg[io[b - 1]];
      }
      cur = res - Alreadychoosen + afterEffect - del;
    }
    ans = max(ans, cur);
  }
  cout << ans << endl;
  return 0;
}
