#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const double pi = acos(-1);
long long t, n, i, j, k;
long long a, b;
pair<long long, long long> c[200002];
long long mul;
int main() {
  scanf("%lld %lld %lld", &n, &a, &b);
  for (i = 0; i < n; i++) scanf("%lld %lld", &c[i].first, &c[i].second);
  sort(c, c + n,
       [](const pair<long long, long long> &a,
          const pair<long long, long long> &b) {
         return a.first + b.second > a.second + b.first;
       });
  long long sum = 0, temp = b;
  for (i = 0; i < n; i++) {
    if (temp) {
      if (c[i].first > c[i].second) {
        sum += c[i].first;
        temp--;
      } else
        sum += c[i].second;
    } else
      sum += c[i].second;
  }
  if (a && b) {
    temp = sum;
    for (i = 0; i < b; i++) {
      sum = max(sum, temp - max(c[i].first, c[i].second) +
                         max((c[i].first << a), c[i].second));
    }
    temp = temp - max(c[b - 1].first, c[b - 1].second) + c[b - 1].second;
    for (i = b; i < n; i++) {
      sum = max(sum, temp - c[i].second + (c[i].first << a));
    }
  }
  printf("%lld\n", sum);
  return 0;
}
