import io, os
input = io.StringIO(os.read(0, os.fstat(0).st_size).decode()).readline

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())

n, k = map(int, input().split())
song_list = [li() for i in range(n)]

song_list = sorted((b, t) for t, b in song_list)
song_list.reverse()
# song_list = sorted(song_list, key = lambda val: (val[1], val[0]), reverse = True)
# print(song_list)
ans, sum = 0, 0
T = min(n, k)
for i in range(T):
    sum += song_list[i][1]
    ans = max(ans, sum*song_list[i][0])
print(ans)