import javafx.util.Pair;

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

public class Main {
    static class TaskC {
        int n, k;
        void solve(InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            List<Pair<Integer, Integer>> list = new ArrayList<>();

            for (int i = 0; i < n; ++i) {
                int ti, bi;
                ti = in.nextInt();
                bi = in.nextInt();
                list.add(new Pair<>(ti, bi));
            }

            list.sort((f, s) -> s.getValue()-f.getValue());

            int cnt = 0;
            TreeSet<Integer> set = new TreeSet<>();
            int allLen = 0;
            int ans = -1;
            for (int i = 0; i < list.size(); ++i) {
                int _k = list.get(i).getKey();
                int _v = list.get(i).getValue();
                if (cnt < k) {
                    cnt++;
                    allLen += _k;
                    set.add(_k);
                } else {
                    allLen += k;
                    set.add(_k);
                    Iterator<Integer> it = set.iterator();
                    allLen -= it.next();
                    it.remove();
                }
                ans = Math.max(ans, allLen*_v);
            }
            out.println(ans);
        }
    }

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(in, out);
        out.close();
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

        public int nextInt() {
            return Integer.parseInt(next());
        }
    }
}
