#include <bits/stdc++.h>
using std ::sort;
template <typename T>
T max(T x, T y) {
  return (x > y) ? x : y;
}
template <typename T>
T min(T x, T y) {
  return (x < y) ? x : y;
}
template <typename T>
bool chkmax(T &x, T y) {
  return (x >= y) ? 0 : (x = y, 1);
}
template <typename T>
bool chkmin(T &x, T y) {
  return (x <= y) ? 0 : (x = y, 1);
}
template <typename T>
T read(T &in) {
  in = 0;
  char ch;
  T f = 1;
  while (!isdigit(ch = getchar()))
    if (ch == '-') f = -1;
  while (isdigit(ch)) in = in * 10 + ch - '0', ch = getchar();
  return in *= f;
}
static const int max1 = 200000 + 11;
int n, a, b;
long long Ans;
long long hp[max1], dmg[max1];
int id[max1];
bool cmp(int x, int y) { return hp[x] - dmg[x] > hp[y] - dmg[y]; }
int main() {
  read(n), read(a), read(b);
  for (int i = (1), ir = (n); i <= (ir); ++i)
    read(hp[i]), read(dmg[i]), id[i] = i;
  sort(1 + id, 1 + n + id, cmp);
  long long t = 0;
  for (int i = (1), ir = (b); i <= (ir); ++i) t += max(hp[id[i]], dmg[id[i]]);
  for (int i = (b + 1), ir = (n); i <= (ir); ++i) t += dmg[id[i]];
  Ans = t;
  for (int i = (1), ir = (b); i <= (ir); ++i) {
    long long _hp = hp[id[i]], _dmg = dmg[id[i]];
    chkmax(Ans, t - max(_hp, _dmg) + max(_hp << a, _dmg));
  }
  if (b) {
    t -= max(hp[id[b]], dmg[id[b]]) - dmg[id[b]];
    for (int i = (b + 1), ir = (n); i <= (ir); ++i) {
      chkmax(Ans, t - dmg[id[i]] + max(hp[id[i]] << a, dmg[id[i]]));
    }
  }
  printf("%lld\n", Ans);
  return 0;
}
