import heapq
n, k = map(int, str(input()).split(' '))
tab = []
for i in range(n):
	ti, bi = map(int, str(input()).split(' '))
	tab.append((bi, ti))

tab.sort(key=lambda e: -e[0])
temps = 0
maxi = -float("inf")
h = []
for ii in range(n):
	bb, tt = tab[ii]
	if len(h) < k:
		temps+=tt
		heapq.heappush(h, tt)
	else:
		tta = heapq.heappushpop(h, tt)
		temps+=(tt - tta)
	maxi = max(maxi, bb*temps)

print(maxi)
