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

public class E {

    public static void main(String[] args) {
        FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = 1;
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, FastReader scan, PrintWriter out) {
            int n = scan.nextInt(), k = scan.nextInt();
            Item[] a = new Item[n];
            for(int i = 0; i < n; i++) a[i] = new Item(scan.nextInt(), scan.nextInt());
            Arrays.sort(a);
            PriorityQueue<Long> queue = new PriorityQueue<>();
            long sum = 0, best = 0;
            for(int i = 0; i < n; i++) {
                sum += a[i].len;
                queue.add(a[i].len);
                if(queue.size() > k) sum -= queue.poll();
                best = Math.max(best, sum * a[i].beauty);
            }
            out.println(best);
        }

        static class Item implements Comparable<Item> {
            long len, beauty;
            public Item(long a, long b) {
                len = a;
                beauty = b;
            }

            @Override
            public int compareTo(Item item) {
                return Long.compare(item.beauty, beauty);
            }
        }

    }

    static void shuffle(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffle(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        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;
        }
    }

}