#include <bits/stdc++.h>
using namespace std;
int xd[] = {1, 0, -1, 0, 1, 1, -1, -1};
int yd[] = {0, -1, 0, 1, 1, -1, 1, -1};
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
inline bool isEqual(double x, double y) {
  const double epsilon = 1e-5;
  return abs(x - y) <= epsilon * abs(x);
}
long double triarea(long long x1, long long y1, long long x2, long long y2,
                    long long x3, long long y3) {
  return (long double)abs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) /
         2.0;
}
bool triinside(long x1, long y1, long x2, long y2, long x3, long y3, long x,
               long y) {
  long area1 = triarea(x1, y1, x2, y2, x3, y3);
  long area2 = triarea(x, y, x2, y2, x3, y3);
  long area3 = triarea(x1, y1, x, y, x3, y3);
  long area4 = triarea(x1, y1, x2, y2, x, y);
  if (isEqual(area1, area2 + area3 + area4)) return true;
  return false;
}
long long dist(long long x1, long long y1, long long x2, long long y2) {
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
const double pi = acos(-1.0);
long double todegree(long double radian) {
  if (radian < 0) radian += 2 * pi;
  return radian * 180 / pi;
}
long double toradian(long double degree) { return degree * pi / 180.0; }
long long poww(long long x, long long k) {
  long long ret = 1;
  while (k) {
    if (k & 1) ret = (ret * x);
    k >>= 1;
    x = (x * x);
  }
  return ret;
}
long long sumOfNumbers(long long num) {
  long long ret = 0;
  while (num) {
    ret += num % 10;
    num /= 10;
  }
  return ret;
}
unsigned long long fact(unsigned long long n) {
  unsigned long long sum = 1;
  while (n > 1) {
    sum *= n;
    n--;
  }
  return sum;
}
unsigned long long combination(unsigned long long a, unsigned long long b) {
  long long ret = 1;
  for (int i = 0; i < b; i++) ret = ret * (a - i) / (i + 1);
  return ret;
}
int main() {
  std::ios_base::sync_with_stdio(0);
  int n, k;
  scanf("%d%d", &n, &k);
  vector<pair<long long, int>> vi2;
  vector<pair<int, int>> vi;
  for (int i = 0; i < (int)(n); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    vi.push_back({a, b});
    vi2.push_back({a * b, i});
  }
  sort((vi2).begin(), (vi2).end());
  long long sum = 0, mult = 10000000000;
  for (int i = n - 1; i >= 0; i--) {
    if (k == 0) break;
    int beaut = vi[vi2[i].second].second;
    int valu = vi[vi2[i].second].first;
    if ((sum + valu) * min((long long)beaut, mult) < sum * mult) {
      break;
    } else {
      sum += valu;
      mult = min((long long)beaut, mult);
    }
    k--;
  }
  cout << (long long)sum * mult;
  return 0;
}
