from heapq import heappush, heappop
heapObj = []
n,k = map(int, input().strip().split())
l = []
for i in range(n):
    t,b = map(int, input().strip().split())
    l.append([b,t])
l.sort()
ct = 0
ans = 0
sm = 0
for i in range(n-1,-1,-1):
    if ct < k:
        ct += 1
        sm += l[i][1]
        heappush(heapObj, l[i][1])
    else:
        mn = heapObj[0]
        if l[i][1] > mn:
            heappop(heapObj)
            heappush(heapObj,l[i][1])
            sm = sm - mn + l[i][1]
    ans = max(ans,l[i][0]*sm)
print(ans)