N, M = map(int, input().split())
AB = []

for _ in range(N):
  A, B = map(int, input().split())
  AB.append((A, B))

AB.sort()

i = 0
ans = 0

while M > 0:
  A, B = AB[i]
  if B <= M:
    ans += A * B
    M -= B
  else:
    ans += A * M
    M = 0
  i += 1

print(ans) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M AB = [] AB [] for _ in range(N):
  A, B = map(int, input().split())
  AB.append((A, B)) _ 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 AB.sort() AB.sort AB sort i = 0 i 0 ans = 0 ans 0 while M > 0:
  A, B = AB[i]
  if B <= M:
    ans += A * B
    M -= B
  else:
    ans += A * M
    M = 0
  i += 1 M > 0 M 0 A, B = AB[i] A AB[i] AB i B if B <= M:
    ans += A * B
    M -= B
  else:
    ans += A * M
    M = 0
   B <= M B M ans += A * B ans A * B A B M -= B M B ans += A * M ans A * M A M M = 0 M 0 i += 1 i 1 print(ans) print ans ans += A * M A * M ans B = AB[i] AB[i] B A, B = AB[i] AB[i] A M = map(int, input().split()) map(int, input().split()) M i = 0 0 i M = 0 0 M N, M = map(int, input().split()) map(int, input().split()) N M -= B B M ans = 0 0 ans A, B = map(int, input().split()) map(int, input().split()) A ans += A * B A * B ans B = map(int, input().split()) map(int, input().split()) B i += 1 1 i AB = [] [] AB
N, M = map(int, input().split())
AB = []

for _ in range(N):
  A, B = map(int, input().split())
  AB.append((A, B))

AB.sort()

i = 0
ans = 0

while M > 0:
  A, B = AB[i]
  if B <= M:
    ans += A * B
    M -= B
  else:
    ans += A * M
    M = 0
  i += 1

print(ans)