#include <bits/stdc++.h>
using namespace std;
long long a[323402], n, b[323402], k, s, t, ans, d[323402], sum[323402];
pair<long long, long long> c[323402];
int main() {
  scanf("%d%d%d", &n, &s, &t);
  t = min(n, t);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a[i], &b[i]);
    ans += b[i];
    c[i].first = b[i] - a[i];
    c[i].second = i;
  }
  sort(c, c + n);
  k = ans;
  if (t == 0) {
    cout << ans << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) d[c[i].second] = i;
  sum[0] = max(0ll, -c[0].first);
  for (int i = 1; i < n; i++) sum[i] = sum[i - 1] + max(0ll, -c[i].first);
  for (int i = 0; i < n; i++) {
    if (d[i] < t)
      ans =
          max(ans, k + sum[t - 1] - max(0ll, a[i] - b[i]) - b[i] + (a[i] << s));
    else
      ans = max(ans, k + sum[t - 2] - b[i] + (a[i] << s));
  }
  cout << ans << endl;
}
