import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;

/**
 * monster
 */
public class playlist {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(reader.readLine());
        int n = Integer.parseInt(st.nextToken());
        long k = Integer.parseInt(st.nextToken());
        tb[] arr = new tb[n];
        for (int i = 0; i < n; i++) {
            st = new StringTokenizer(reader.readLine());
            long t = Long.parseLong(st.nextToken());
            long b = Long.parseLong(st.nextToken());
            arr[i] = new tb(t, b);
        }
        Arrays.sort(arr);
        long ans = Long.MIN_VALUE;
        long tot = 0;
        long min = Long.MAX_VALUE;
        for (int i = arr.length - 1; k > 0; i--, k--) {
            tot += arr[i].t;
            if (arr[i].b < min) {
                min = arr[i].b;
            }
            if ((tot * min) > ans)
                ans = tot * min;
        }
        System.out.println(ans);
    }
}

class tb implements Comparable<tb> {
    long t, b;

    tb(long t, long b) {
        this.t = t;
        this.b = b;
    }

    public int compareTo(tb m) {
        long thi = this.t * this.b;
        long tha = m.t * m.b;
        if (thi - tha < 0)
            return -1;
        else if (thi - tha == 0)
            return 0;
        else
            return 1;
    }
}