R=lambda:  map(int,input().split())
n,k=R()
l=[]
for _ in range(n):
    a,b=R()
    l.append((b,a))
l=sorted(l)[::-1]
re=0
su,mu=0,10**7
for i in range(k):
    su+= l[i][1]
    mu=min(mu,l[i][0])
    re=max(re,su*mu)
print (re)

