#include <bits/stdc++.h>
using namespace std;
const int N = 200001;
const long long MOD = 1e9 + 7;
int n, a, b;
long long h[N], d[N];
int main() {
  scanf("%d%d%d", &n, &a, &b);
  vector<pair<long long, int> > v;
  for (int i = 0; i < n; i++) {
    scanf("%lld%lld", h + i, d + i);
    v.push_back(make_pair(h[i] - d[i], i));
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  long long ans = 0;
  long long A = 1ll << a;
  if (b) {
    int s = min(n, b);
    long long tmp = 0;
    for (int i = 0; i < s; i++) tmp += max(h[v[i].second], d[v[i].second]);
    for (int i = s; i < n; i++) tmp += d[v[i].second];
    for (int i = 0; i < n; i++) {
      if (i < s)
        ans = max(ans, tmp -
                           (i < s ? max(h[v[i].second], d[v[i].second])
                                  : d[v[i].second]) +
                           max(d[v[i].second], h[v[i].second] * A));
      else
        ans = max(ans, tmp -
                           (i < s ? max(h[v[i].second], d[v[i].second])
                                  : d[v[i].second]) +
                           max(d[v[i].second],
                               h[v[i].second] * A -
                                   max(d[v[s - 1].second], h[v[s - 1].second]) +
                                   d[v[s - 1].second]));
    }
  } else {
    for (int i = 0; i < n; i++) ans += d[v[i].second];
  }
  printf("%lld\n", ans);
  return 0;
}
