import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class CF1140C {
    static class Song implements Comparable<Song>{
        int duration;
        int beauty;
        Song(int duration,int beauty){
            this.duration = duration;
            this.beauty = beauty;
        }
        public int compareTo(Song other){
            if(this.beauty == other.beauty){
                return 0;
            }
            else if(this.beauty > other.beauty){
                return -1;
            }
            else{
                return 1;
            }
        }
    }
    public static void main(String[] args) {
        FastReader input = new FastReader();
        int n = input.nextInt();
        int k = input.nextInt();
        ArrayList<Song> list = new ArrayList<Song>();
        for(int i = 0;i < n;i++){
            list.add(new Song(input.nextInt(),input.nextInt()));
        }
        Collections.sort(list);
//        for(Song s : list){
//            System.out.println(s.duration + " " + s.beauty);
//        }
        long total = 0;
        long max = 0;
        PriorityQueue<Integer> pq = new PriorityQueue<Integer>();
        for(int i = 0;i < n;i++){
            total += list.get(i).duration;
            pq.add(list.get(i).duration);
            while(pq.size() > k){
                total -= pq.poll();
            }
            max = Math.max(max,total * list.get(i).beauty);
        }
        System.out.println(max);
    }
    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;
        }
    }
}
