#!/usr/bin/env python
#region
from __future__ import division, print_function

import os
import sys

if sys.version_info[0] < 3:
    from cStringIO import StringIO
    from itertools import ifilter, imap, izip
else:
    from io import BytesIO as StringIO

input = StringIO(os.read(0, os.fstat(0).st_size)).readline
sys.stdout = StringIO()

if sys.version_info[0] < 3:
    range = xrange
    filter, map, zip = ifilter, imap, izip
else:
    _write = sys.stdout.write
    sys.stdout.write = lambda s: _write(s.encode())

#endregion

#input = lambda: input().rstrip('\r\n')

from heapq import heappop, heappush


def main():
    n, k = map(int, input().split())

    t, b = [0] * n, [0] * n
    for i in range(n):
        t[i], b[i] = map(int, input().split())

    res, tot = 0, 0
    klargest = []
    for xi in sorted(zip(b, t), reverse=True):
        tot += xi[1]
        heappush(klargest, xi[1])
        if len(klargest) > k:
            tot -= heappop(klargest)

        res = max(res, tot * xi[0])

    print(res)


if __name__ == '__main__':
    main()
    os.write(1, sys.stdout.getvalue())
