from __future__ import print_function
from sys import stdin
from collections import *
from operator import itemgetter
from heapq import *
import os, sys, atexit


if sys.version_info[0] < 3:
    range = xrange
    from cStringIO import StringIO as BytesIO

    sys.stdout = BytesIO()
else:
    from io import BytesIO

    sys.stdout = BytesIO()
    _write = sys.stdout.write
    sys.stdout.write = lambda s: _write(s.encode())
atexit.register(lambda: os.write(1, sys.stdout.getvalue()))

input = BytesIO(os.read(0, os.fstat(0).st_size)).readline


def arr_inp(n):
    if n == 1:
        return [int(x) for x in input().split()]
    elif n == 2:
        return [float(x) for x in stdin.readline().split()]
    else:
        return list(stdin.readline()[:-1])


n, k = arr_inp(1)
cur, ans, queue, arr = 0, 0, [], []

heapify(queue)
for i in range(n):
    x, y = arr_inp(1)
    arr.append([x, y])

arr.sort(key=lambda x: x[1], reverse=True)

for i in range(n):
    heappush(queue, arr[i][0])
    cur += arr[i][0]

    if i >= k:
        cur -= heappop(queue)
    ans = max(ans, cur * arr[i][1])
print(ans)
