#include <bits/stdc++.h>
using namespace std;
struct node {
  long long int x, y, z;
} d[200005];
bool cmp(node a, node b) { return a.z > b.z; }
int main() {
  long long int n, a, b;
  cin >> n >> a >> b;
  long long int ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> d[i].x >> d[i].y;
    d[i].z = d[i].x - d[i].y;
    ans += d[i].y;
  }
  sort(d + 1, d + 1 + n, cmp);
  b = min(n, b);
  if (b == 0) {
    cout << ans << endl;
    return 0;
  }
  for (int i = 1; i <= b; i++) {
    if (d[i].z < 0) break;
    ans += d[i].z;
  }
  long long int Ans = ans;
  for (int i = 1; i <= n; i++) {
    long long int tans = ans;
    if (i <= b) {
      tans += max(d[i].x << a, d[i].y) - d[i].y;
      tans -= max((long long int)0, d[i].z);
    } else {
      tans += max(d[i].x << a, d[i].y) - d[i].y;
      tans -= max((long long int)0, d[b].z);
    }
    Ans = max(Ans, tans);
  }
  cout << Ans << endl;
  return 0;
}
