import java.io.*;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class C {

    static StringTokenizer st;
    static BufferedReader br;

    static String nextToken() {
        try {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st.nextToken();
    }

    static String nextString() throws IOException {
        return br.readLine();
    }

    static char nextChar() throws IOException {
        return (char) br.read();
    }

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

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

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


    public static void main(String[] args) {
        br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        int n = nextInt();
        int k = nextInt();
        Pair[] a = new Pair[n];
        for (int i = 0; i < n; i++) {
            a[i] = new Pair(nextInt(), nextInt());
        }
        Arrays.sort(a);
        long ans = a[0].t * a[0].b;
        long max = a[0].t;
        long min = a[0].b;
        for (int i = 1; i < k; i++) {
            min = Math.min(min, a[i].b);
            max += a[i].t;
            ans = Math.max(max * min, ans);
        }
        pw.print(ans);
        pw.close();
    }
}

class Pair implements Comparable<Pair> {
    int t;
    int b;

    public Pair(int t, int b) {
        this.t = t;
        this.b = b;
    }

    @Override
    public String toString() {
        return "Pair{" +
                "t=" + t +
                ", b=" + b +
                '}';
    }

    @Override
    public int compareTo(Pair o) {
        return Integer.compare(o.t * o.b, t * b);
    }
}