n, k = map(int, input().split())
l = []
for _ in range(n):
    t, b = map(int, input().split())
    l.append((b, t))
l = sorted(l, key = lambda x: x[0], reverse = True)
m = min(k, n)
su = l[0][1]
c = l[0][0]
ans = l[0][1]*l[0][0]

for i in range(1, m):
    if (su+l[i][1])*l[i][0] > ans:
        su += l[i][1]
        c = l[i][0]

print(su*c)
