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

public class C{
    class Song{
        int l;
        int b;
        Song(int l,int b) {
            this.l = l;
            this.b = b;
        }
    }
    private void solve() {
        int n=nextInt();
        int k=nextInt();
        ArrayList<Song>arr=new ArrayList<>();
        for(long i=0;i<n;i++){
            int x=nextInt();
            int y=nextInt();
            arr.add(new Song(x,y));
        }
        Collections.sort(arr, new Comparator<Song>() {
            @Override
            public int compare(Song o1, Song o2) {
                return Integer.compare(o1.b, o2.b);
            }
        });
        PriorityQueue<Integer>queue=new PriorityQueue<>();
        long sum=0;
        long res=0;
        for(int i=n-1;i>=0;i--){
            sum=sum+arr.get((int) i).l;
            queue.add(arr.get(i).l);
            if(queue.size()>k){
                long tp=queue.peek();
                queue.remove();
                sum=sum-tp;
            }
            long temp=(arr.get((int) i).b*sum);
            res=Math.max(res,temp);

        }
        writer.println(res);
    }

    public static void main(String[] args) {
        new C().run();
    }
    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    private void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            writer = new PrintWriter(System.out);
            tokenizer = null;
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    private String nextToken() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    private int nextInt() {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() {
        return Double.parseDouble(nextToken());
    }
}