n, k = (int(x) for x in input().rstrip().split())
vals = []
for i in range(n):
	ti, bi = (int(x) for x in input().rstrip().split())
	vals.append((bi,ti))
vals.sort()
bcurr = vals[-1][0]
currdim = 1
currcost = vals[-1][1]
bestcost = vals[-1][1] * bcurr
ind = 1
while currdim < k:
	ind += 1
	bval = vals[-ind][0]
	if bval < bcurr:
		bestcost = max(currcost * bcurr, bestcost)
		bcurr = bval
	currcost += vals[-ind][1]
	currdim += 1
bestcost = max(bestcost, bcurr*currcost)
print(bestcost)