//package main;

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

public final class Main {
    Scanner sc;

    public static void main(String[] args) throws Exception {
        new Thread(null, new Main()::run, "main", 1 << 26).start();
    }
    
    {
        sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
    }
    
    void run() {
        int n = sc.nextInt();
        int k = sc.nextInt();
        Pair[] pair = new Pair[n];
        for(int i=0; i<n; i++)
            pair[i] = new Pair(sc.nextLong(), sc.nextLong());
        Arrays.sort(pair);
        for(int i=0, j=n-1; i<j; i++, j--) {
            Pair temp = pair[i];
            pair[i] = pair[j];
            pair[j] = temp;
        }
        //System.out.println(Arrays.toString(pair));
        
        PriorityQueue<Long> queue = new PriorityQueue<>();
        long ans = 0, sum = 0;
        for(int i = n - 1; i >= 0; i--) {
            queue.add(pair[i].length);
            sum += pair[i].length;
            while(queue.size() > k) {
                sum -= queue.remove();
            }
            ans = Math.max(ans, sum * pair[i].beauty);
        }
        
        System.out.println(ans);
    }
    
    class Pair implements Comparable<Pair> {
        long length, beauty;
        public Pair(long length, long beauty) {
            this.length = length;
            this.beauty = beauty;
        }
        @Override
        public int compareTo(Pair pair) {
            return Long.compare(pair.beauty, beauty);
        }
        @Override
        public String toString() {
            return "[" + length + ", " + beauty + "]";
        }
    }
}