songs = []
n, k = map(int, input().split())
for i in range(n):
    a, b = map(int, input().split())
    songs.append([b, a])
songs.sort(key=lambda p: (-p[0] * p[1], p[0], p[1]))
minn = 10 ** 7
nice = 10 ** 7
summ = 0
maxsum = 0
i = 0
while i <= k:
    summ += songs[i][1]
    nice = min(songs[i][0], nice)
    maxsum = max(maxsum, summ * nice)
    i += 1
print(maxsum)