l=list(map(int,input().split()))
n=l[0]
k=l[1]
l3=[]
l4=[]
d={}
s=0
s2=0
j=0
w=0
for i in range(n):
   l=input().split()
   d[int(l[1])]=int(l[0])
l1=list(d.keys())
l1.sort()
for i in range(k):
    b=d[l1[-1]]
    a=l1[-1]
    l1.pop()
    d.pop(a)
    l3.append(a)
    l4.append(b)
    w=w+b
    s2=w*a
    if s2<=s and j!=0:
        break
    else:
        j=1
        s=s2
print(s)