import math
import random
import sys
from collections import defaultdict as dd
mod = 7 + 10 ** 9

n, k = [int(i) for i in input().split()]
t = []
b = []
for _ in range(n):
    x, y = [int(i) for i in input().split()]
    t.append(x)
    b.append(y)
l = []
for i in range(n):
    l.append([t[i]*b[i], (b[i], t[i])])
l.sort(reverse = 1)
ans = 0
min_yet = l[0][1][0]
sum_yet = 0
ans = 0
for i in range(k):
    sum_yet += l[i][1][1]
    min_yet = min(min_yet, l[i][1][0]) 
    ans = max(ans, min_yet * sum_yet)
print(ans)
