import java.util.*;
public class Main
{   long length;
    long beauty;
    public Main(long length,long beauty){
        this.length=length;
        this.beauty=beauty;
    }
    public long getBeauty(){
        return beauty;
    }
    public String toString(){
        return length+" "+beauty;
    }
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int limit=sc.nextInt();
		Main[] arr=new Main[n];
		for(int i=0;i<n;i++){
		    arr[i] =new Main(sc.nextInt(),sc.nextInt());
		}
		Arrays.sort(arr,Comparator.comparing(Main::getBeauty).reversed());
		PriorityQueue<Long> pq = new PriorityQueue<Long>();
		long sum=0,max=0;
		for(int i=0;i<n;i++){
            sum+=arr[i].length;
            pq.add(arr[i].length);
            if(pq.size()>limit)
            sum-=pq.poll();
            max=Math.max(max,arr[i].beauty*sum);
		}
		System.out.println(max);
	}
}
