#include <bits/stdc++.h>
using namespace std;
struct node {
  long long x, y;
  bool operator<(const node &tmp) const { return x - y > tmp.x - tmp.y; }
};
int main() {
  int n, a, b;
  long long sum;
  node m[200010];
  while (scanf("%d%d%d", &n, &a, &b) != EOF) {
    memset(m, 0, sizeof(m));
    sum = 0;
    for (int i = 1; i <= n; i++) scanf("%I64d%I64d", &m[i].x, &m[i].y);
    sort(m + 1, m + n + 1);
    for (int i = 1; i <= b; i++) sum += max(m[i].x, m[i].y);
    for (int i = b + 1; i <= n; i++) sum += m[i].y;
    long long ans = sum;
    for (int i = 1; i <= b; i++)
      ans = max(ans, sum - max(m[i].x, m[i].y) + (m[i].x << a));
    sum = sum - max(m[b].x, m[b].y) + m[b].y;
    for (int i = b + 1; i <= n && b; i++)
      ans = max(ans, sum - m[i].y + (m[i].x << a));
    printf("%I64d\n", ans);
  }
  return 0;
}
