import java.util.*;
import java.math.*;
import java.io.*;
 public class Solution {
	 static class FastReader 
	    { 
	        BufferedReader br; 
	        StringTokenizer st; 
	  
	        public FastReader() 
	        { 
	            br = new BufferedReader(new
	                     InputStreamReader(System.in)); 
	        } 
	  
	        String next() 
	        { 
	            while (st == null || !st.hasMoreElements()) 
	            { 
	                try
	                { 
	                    st = new StringTokenizer(br.readLine()); 
	                } 
	                catch (IOException  e) 
	                { 
	                    e.printStackTrace(); 
	                } 
	            } 
	            return st.nextToken(); 
	        } 
	  
	        int nextInt() 
	        { 
	            return Integer.parseInt(next()); 
	        } 
	  
	        long nextLong() 
	        { 
	            return Long.parseLong(next()); 
	        } 
	  
	        double nextDouble() 
	        { 
	            return Double.parseDouble(next()); 
	        } 
	  
	        String nextLine() 
	        { 
	            String str = ""; 
	            try
	            { 
	                str = br.readLine(); 
	            } 
	            catch (IOException e) 
	            { 
	                e.printStackTrace(); 
	            } 
	            return str; 
	        } 
	    }
	  
  public static void main(String [] args) {
	FastReader ip=new FastReader();
	int n=ip.nextInt();
	int k=ip.nextInt();
	TreeMap<Long,Long> hm=new TreeMap<>(Collections.reverseOrder());
	for(int i=0;i<n;i++) {
		long a=ip.nextLong();
		long b=ip.nextLong();
		hm.put(b,a);
	}
	long max=0;
	long sum=0;
	ArrayList<Long> al=new ArrayList<>();
	int len=0;
	int start=0;
	for(long x:hm.keySet()) {
		if(len<=k) {
			sum+=hm.get(x);
			long ans=sum*x;
			if(ans>max) {
				max=ans;
			}
			al.add(hm.get(x));
			len++;
		}else {
			sum-=al.get(start);
			sum+=hm.get(x);
			long ans=sum*x;
			if(ans>max) {
				max=ans;
			}
			al.add(hm.get(x));
			start++;
		}
	}
	System.out.println(max);
  }
}
