from sys import stdin

input = stdin.readline

if __name__ == '__main__':
    n, k = map(int, input().split())
    arr = [tuple(map(int, input().split())) for _ in range(n)]

    arr.sort(key=lambda t: (t[1], -t[0]))

    l = sum(map(lambda o: o[0], arr[:k]))
    b = arr[0][1]
    mx = l * b

    for i in range(1, n):
        b = arr[i][1]
        if k + i <= len(arr):
            l += arr[k + i - 1][0]
        l -= arr[i - 1][0]
        mx = max(mx, l * b)

    print(mx)
