from itertools import combinations
import random

n, k = map(int, input().split(' '))

songs = list()

for _ in range(n):
    t, b = map(int, input().split(' '))
    songs.append([t, b, t*b])

songs = sorted(songs, key=lambda item: (item[2], item[0]), reverse=True)

#print(songs)

res = list()

for z in range(1, k+1):
    comb = songs[:z]
    b_min = min([d[1] for d in comb])
    t_sum = sum([d[0] for d in comb])
 #   print(z, comb, b_min, t_sum, t_sum * b_min)
    res.append(t_sum * b_min)

print(max(res))
