import heapq

n, k = [int(i) for i in str(raw_input()).split(' ')]
t = [0] * n
b = [0] * n

for i in xrange(n):
    t[i], b[i] = [int(j) for j in str(raw_input()).split(' ')]
    
t_sum = 0
i = 0
h = []

while i < k:
    heapq.heappush(h, (b[i], t[i]))
    t_sum += t[i]
    i += 1

while i < n:
    min_elem = h[0]
    if t_sum * min_elem[0] < (t_sum - min_elem[1] + t[i]) * b[i]:
        heapq.heappop(h)
        heapq.heappush(h, (b[i], t[i]))
        t_sum = t_sum - min_elem[1] + t[i]
    i += 1

max_pleasure = t_sum * h[0][0]
while len(h):
    max_pleasure = max(max_pleasure, t_sum * h[0][0])
    t_sum -= h[0][1]
    heapq.heappop(h)
    
print max_pleasure
