n,k=map(int,input().split())
ar=[]
for i in range(n):
    ar.append(list(map(int,input().split())))
ar.sort(key=lambda x:x[1])
li=[]
su=0
for i in range(k):
    su+=ar[i][0]
li.append(su)
ans=ar[0][1]*su
for i in range(1,n):
    su-=ar[i-1][0]
    if(k+i-1<n):
        su+=ar[i+k-1][0]
    li.append(su)
    ans=max(ans,su*ar[i][1])
print(ans)