n, k = map(int, input().split())
music = []
for i in range(n):
    music.append(list(map(int, input().split())))

music = sorted(music, key=lambda x: x[1], reverse = True)
print(music)
maximum = -1
c = 0
for i in range(k):
    c += music[i][0]
    maximum = max(maximum, c * music[i][1])
    # print(maximum)

print(maximum)