N, M = map(int, input().split())
AB = []
for i in range(N):
  a, b = map(int, input().split())
  AB.append([a, b])

ans = 0
for ab in sorted(AB, key=lambda x: x[0]):
  if M >= ab[1]:
    ans += ab[0] * ab[1]
    M -= ab[1]
  else:
    ans += ab[0] * M
    M = 0
  if M <= 0:
    break

print(ans) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M AB = [] AB [] for i in range(N):
  a, b = map(int, input().split())
  AB.append([a, b]) i range(N) range N a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b AB.append([a, b]) AB.append AB append [a, b] a b ans = 0 ans 0 for ab in sorted(AB, key=lambda x: x[0]):
  if M >= ab[1]:
    ans += ab[0] * ab[1]
    M -= ab[1]
  else:
    ans += ab[0] * M
    M = 0
  if M <= 0:
    break ab sorted(AB, key=lambda x: x[0]) sorted AB key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x if M >= ab[1]:
    ans += ab[0] * ab[1]
    M -= ab[1]
  else:
    ans += ab[0] * M
    M = 0
   M >= ab[1] M ab[1] ab 1 ans += ab[0] * ab[1] ans ab[0] * ab[1] ab[0] ab 0 ab[1] ab 1 M -= ab[1] M ab[1] ab 1 ans += ab[0] * M ans ab[0] * M ab[0] ab 0 M M = 0 M 0 if M <= 0:
    break M <= 0 M 0 break print(ans) print ans ans += ab[0] * M ab[0] * M ans M = 0 0 M M = map(int, input().split()) map(int, input().split()) M b = map(int, input().split()) map(int, input().split()) b N, M = map(int, input().split()) map(int, input().split()) N a, b = map(int, input().split()) map(int, input().split()) a ans += ab[0] * ab[1] ab[0] * ab[1] ans M -= ab[1] ab[1] M AB = [] [] AB ans = 0 0 ans
N, M = map(int, input().split())
AB = []
for i in range(N):
  a, b = map(int, input().split())
  AB.append([a, b])

ans = 0
for ab in sorted(AB, key=lambda x: x[0]):
  if M >= ab[1]:
    ans += ab[0] * ab[1]
    M -= ab[1]
  else:
    ans += ab[0] * M
    M = 0
  if M <= 0:
    break

print(ans)