n, k = input().split()
n = int(n); k = int(k);
v = []
ans = 0
soma = 0

for i in range(0, n):
	t, b = input().split()
	t = int(t); b = int(b)
	v.append((b, t))
	soma += t

v.sort()

for x in v:
	atual = soma * x[0]
	ans = max(ans, atual)
	soma -= x[1]

print(ans)