#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long INF64 = 1e18;
const long long MOD = INF + 7;
const double EPS = 1e-9;
struct niki {
  long long hp, dmg, d;
};
bool cmp(niki a, niki b) { return a.d > b.d; }
int main() {
  ios_base::sync_with_stdio(false);
  int n, a, b;
  cin >> n >> a >> b;
  b = min(b, n);
  long long s = 0;
  vector<niki> c(n);
  for (int i = 0; i < n; i++) {
    cin >> c[i].hp >> c[i].dmg;
    c[i].d = max(0ll, c[i].hp - c[i].dmg);
    s += c[i].dmg;
  }
  long long t = 0, ans = 0;
  sort(c.begin(), c.end(), cmp);
  for (int i = 0; i < b; i++) t += c[i].d;
  for (int i = 0; i < b; i++)
    ans = max(ans, t - c[i].d + (c[i].hp << a) - c[i].dmg);
  if (!b)
    ans = 0;
  else
    for (int i = b; i < n; i++)
      ans = max(ans, t - c[b - 1].d + (c[i].hp << a) - c[i].dmg);
  cout << s + ans;
  return 0;
}
