#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
int IT_MAX = 1 << 17;
const long long MOD = 998244353;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double ERR = 1e-10;
pair<long long, long long> in[200050];
int main() {
  long long N, A, B, i, j;
  scanf("%lld %lld %lld", &N, &A, &B);
  for (i = 1; i <= N; i++) scanf("%lld %lld", &in[i].first, &in[i].second);
  B = min(B, N);
  sort(in + 1, in + N + 1,
       [](pair<long long, long long> a, pair<long long, long long> b) {
         return a.first - a.second > b.first - b.second;
       });
  long long ans = 0;
  for (i = 1; i <= N; i++) ans += in[i].second;
  if (B == 0) return !printf("%lld\n", ans);
  for (i = 1; i <= B; i++)
    if (in[i].first > in[i].second) ans += in[i].first - in[i].second;
  long long ANS = ans;
  for (i = 1; i <= N; i++) {
    long long tans = ans;
    if (i <= B) {
      tans += max(in[i].first << A, in[i].second) - in[i].second;
      tans -= max(0ll, in[i].first - in[i].second);
    } else {
      tans += max(in[i].first << A, in[i].second) - in[i].second;
      tans -= max(0ll, in[B].first - in[B].second);
    }
    ANS = max(ANS, tans);
  }
  return !printf("%lld\n", ANS);
}
