#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int INF = 1 << 30;
const double eps = 1e-6;
const int mod = 1000000007;
int n, a, b;
struct Node {
  int h, d;
  bool operator<(const Node& rhs) const { return h - d > rhs.h - rhs.d; }
} A[maxn * 2];
int main() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 0; i < n; i++) scanf("%d%d", &A[i].h, &A[i].d);
  sort(A, A + n);
  long long sum = 0;
  for (int i = 0; i < min(b - 1, n); i++) sum += max(A[i].h, A[i].d);
  for (int i = max(0, b - 1); i < n; i++) sum += A[i].d;
  long long ans = sum;
  for (int i = 0; i < min(b - 1, n); i++)
    ans = max(ans, sum - max(A[i].h, A[i].d) + A[i].h * (1ll << a));
  long long sb = ans;
  for (int i = b - 1; i < n && b; i++) {
    ans = max(ans, sb - A[i].d + A[i].h);
    ans = max(ans, sum - A[i].d + A[i].h * (1ll << a));
  }
  printf("%lld\n", ans);
  return 0;
}
