n,k=map(int,raw_input().split())
a=[]
for _ in range(n):
    t=map(int,raw_input().split())
    a.append(t[::-1])
a.sort(reverse=True)
m=0
l=0
c=0
p=a[0][0]
for i in range(k):
    l+=a[i][1]
    p=min(p,a[i][0])
    m=max(m,l*p)
print m