//package codeforces;

import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Playlist {

	static class Node {
		long l;
		long v;
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();

		Node[] nodes = new Node[n];
		for (int i = 0; i < n; i++) {
			Node node = new Node();
			node.l = in.nextLong();
			node.v = in.nextLong();
			nodes[i] = node;
		}

		Arrays.sort(nodes, new Comparator<Node>() {
			@Override
			public int compare(Node o1, Node o2) {
				Long x = o1.v;
				Long y = o2.v;
				return x.compareTo(y);
			}
		});

		PriorityQueue<Long> queue = new PriorityQueue<>();
		long sum = 0;
		long res = 0;
		for (int i = n - 1; i >= 0; i--) {

			if (queue.size() < k) {
				sum += nodes[i].l;
				queue.add(nodes[i].l);
			} else {
				if (nodes[i].l > queue.peek()) {
					long top = queue.poll();
					queue.add(nodes[i].l);
					sum = sum - top + nodes[i].l;
				}
			}
			res = Math.max(res, nodes[i].v * sum);
		}
		System.out.println(res);

		in.close();
	}
}
