import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class C {

    public static void main(String[] args) throws Exception {
        FastScanner scanner = new FastScanner();

        int[] tmp = scanner.nextIntArray();
        int n = tmp[0]; int k = tmp[1];
        ArrayList<Pair> s = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            tmp = scanner.nextIntArray();
            s.add(new Pair(tmp[0], tmp[1]));
        }

        int i = 0, sum = 0;
        PriorityQueue<Pair> index = new PriorityQueue <>();

        while (i < n) {
            if (index.size() < k) {
                if ((sum + s.get(i).t) *
                        (index.isEmpty() ? s.get(i).b : min(index.peek().b, s.get(i).b))
                        > (index.isEmpty() ? 0 : sum * index.peek().b)) {
                    sum += s.get(i).t;
                    index.add(s.get(i));
                }
            } else {
                Pair p = index.poll();
                if ((sum - p.t + s.get(i).t) *
                        (index.isEmpty() ? s.get(i).b : min(index.peek().b, s.get(i).b))
                        > (index.isEmpty() ? 0 : sum * index.peek().b)) {
                    sum = sum - p.t + s.get(i).t;
                    index.add(s.get(i));
                } else {
                    index.add(p);
                }
            }
            i++;
        }

        while (true) {
            Pair p = index.poll();
            if ((sum - p.t) * (index.isEmpty() ? 0 : index.peek().b) > (sum) * p.b) {
                sum -= p.t;
            } else {
                index.add(p);
                break;
            }
        }


        System.out.println(sum * index.poll().b);

    }


    private static class Pair implements Comparable<Pair> {
        int t, b;
        public Pair(int t, int b) {
            this.t = t;
            this.b = b;
        }
        @Override
        public int compareTo(Pair p) {
            if (this.b < p.b)
                return -1;
            if (this.b > p.b)
                return 1;
            return 0;
        }
    }
    private static class FastScanner {
        private BufferedReader br;

        public FastScanner() { br = new BufferedReader(new InputStreamReader(System.in)); }
        public int[] nextIntArray() throws IOException {
            String line = br.readLine();
            String[] strings = line.trim().split("\\s+");
            int[] array = new int[strings.length];
            for (int i = 0; i < array.length; i++)
                array[i] = Integer.parseInt(strings[i]);
            return array;
        }
        public int nextInt() throws IOException { return Integer.parseInt(br.readLine()); }
        public long[] nextLongArray() throws IOException {
            String line = br.readLine();
            String[] strings = line.trim().split("\\s+");
            long[] array = new long[strings.length];
            for (int i = 0; i < array.length; i++)
                array[i] = Long.parseLong(strings[i]);
            return array;
        }
        public ArrayList<Long> nextLongArrayList() throws IOException {
            String line = br.readLine();
            String[] strings = line.trim().split("\\s+");
            ArrayList<Long> array = new ArrayList<Long>();
            for (int i = 0; i < strings.length; i++)
                array.add(Long.parseLong(strings[i]));
            return array;
        }
        public long nextLong() throws IOException { return Long.parseLong(br.readLine()); }
        public double nextDouble() throws IOException { return Double.parseDouble(br.readLine()); }
        public String nextLine() throws IOException { return br.readLine(); }
    }
}
