#include <bits/stdc++.h>
using namespace std;
const long long M = 300005;
long long n, a, b;
struct Node {
  long long h, d, diff;
  Node(long long x, long long y, long long z) {
    h = x;
    d = y;
    diff = z;
  }
};
vector<Node> c;
bool cmp(const Node &a, const Node &b) { return a.diff > b.diff; }
int main() {
  scanf("%lld %lld %lld", &n, &a, &b);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    long long x, y;
    scanf("%lld %lld", &x, &y);
    c.push_back(Node(x, y, max(x - y, (long long)0)));
    sum += c[i].d;
  }
  sort(c.begin(), c.end(), cmp);
  b = min(b, n);
  for (int i = 0; i < b; i++) {
    sum += c[i].diff;
  }
  long long ans = sum;
  for (int i = 0; i < b; i++) {
    ans = max(ans, sum - max(c[i].d, c[i].h) + (c[i].h << a));
  }
  for (int i = b; i < n; i++) {
    if (b > 0) {
      ans = max(ans, sum - c[b - 1].diff + (c[i].h << a) - c[i].d);
    }
  }
  printf("%lld", ans);
  return 0;
}
