import java.util.*;
import java.io.*;

public class File {
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            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());
        }
    }
	
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
		
		
		
		
		int n = sc.nextInt(); // Number songs in playlist
		int k = sc.nextInt(); // Maximum number of songs
		
		
		int[] length = new int[n];
		int[] beauty = new int[n];
		
		for (int i = 0; i < n; i++) {
		    length[i] = sc.nextInt();
		    beauty[i] = sc.nextInt();
		}
		
		Integer[] indices = new Integer[n];
		for (int i = 0; i < n; i++) {
			indices[i] = i;
		}
		
		Arrays.sort(indices, new Comparator<Integer>() {
			@Override
			public int compare(Integer a, Integer b) {
				if (beauty[b] == beauty[a]) {
					return length[b] - length[a];
				}
				
				return beauty[b] - beauty[a];
			}
		});
		
		// Store in increasing order of beauty.
		// Have the current one as the smallest beauty, 
		// Use prefix to calculate the beauty from current to last song.
		long res = 0;
		
		PriorityQueue<Integer> pq = new PriorityQueue<Integer>(new Comparator<Integer>() {
			@Override
			public int compare(Integer a, Integer b) {
				return length[a] - length[b];
			}
		});
		
		long currTotal = 0;
		
		for (int i : indices) {
			long min = beauty[i];
			currTotal += length[i];
			pq.offer(i);
			
			if (pq.size() > k) {
				int top = pq.poll();
				currTotal -= length[top];
			}
			
			res = Math.max(res, min * currTotal);
		}
		
		out.println(res);
		
		
		
		
		
		
		
		out.close();
	}
}








