from sys import stdin,stdout
from itertools import combinations
from collections import defaultdict
import math
import heapq

def listIn():
    return list((map(int,stdin.readline().strip().split())))

def stringListIn():
    return([x for x in stdin.readline().split()])
    
def intIn():
    return (int(stdin.readline()))

def stringIn():
    return (stdin.readline().strip())


if __name__=="__main__":
    n,k=listIn()
    length,beauty=[],[]
    for i in range(n):
        t,b=listIn()
        length.append(t)
        beauty.append((t,b))
        
    beauty=sorted(beauty,key=lambda x:x[1])[::-1]
    li=[]
    #print(beauty)
    ans=0
    final=float("-inf")
    for i in range(n):
        ele=beauty[i]
        b=ele[1]
        if i<k:
            ans+=ele[0]
            heapq.heappush(li,ele[0])
        else:
            if ele[0]>li[0]:
                ans+=ele[0]-li[0]
                heapq.heappop(li)
                heapq.heappush(li,ele[0])
        #print(li)
        
        final=max(final,ans*b)
        #print(final)
    print(final)
        
    