import bisect

def argsort(seq):
    return sorted(range(len(seq)), key=seq.__getitem__)

n, k = map(int, input().split())
a = []
b = []

for i in range(n):
  x, y = map(int, input().split())
  a.append(x)
  b.append(y)

ind = argsort(b)
b = sorted(b)
b = b[::-1]
ind = ind[::-1]
na = []

for i in range(n):
  na.append(a[ind[i]])

a = na
ta = [a[0]]
sm = sum(ta)
mnd = b[0]
count = 1
p = 0
for i in range(1, n):
  if count>=k:
    rs = sm-ta[p]+a[i]
    rd = b[i]
    if rs*rd>sm*mnd:
      sm = rs
      ta[p] = 0
      p+=1
      bisect.insort(ta, a[i])
      mnd = rd
  else:
    rs = sm+a[i]
    rd = b[i]
    if rs*rd>sm*mnd:
      sm = rs
      mnd = rd
      bisect.insort(ta, a[i])
      count+=1


print(sm*mnd)