N, M = map(int, input().split())
items = [ tuple(map(int, input().split())) for _ in range(N) ]
items.sort()
ans = 0
m = 0
for item in items:
  a = min(M - m, item[1])
  m += a
  ans += a * item[0]
print(ans) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M tuple(map(int, input().split())) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split items = [ tuple(map(int, input().split())) for _ in range(N) ] items [ tuple(map(int, input().split())) for _ in range(N) ] items.sort() items.sort items sort ans = 0 ans 0 m = 0 m 0 for item in items:
  a = min(M - m, item[1])
  m += a
  ans += a * item[0] item items a = min(M - m, item[1]) a min(M - m, item[1]) min M - m M m item[1] item 1 m += a m a ans += a * item[0] ans a * item[0] a item[0] item 0 print(ans) print ans m = 0 0 m ans = 0 0 ans items = [ tuple(map(int, input().split())) for _ in range(N) ] [ tuple(map(int, input().split())) for _ in range(N) ] items M = map(int, input().split()) map(int, input().split()) M a = min(M - m, item[1]) min(M - m, item[1]) a N, M = map(int, input().split()) map(int, input().split()) N ans += a * item[0] a * item[0] ans m += a a m
N, M = map(int, input().split())
items = [ tuple(map(int, input().split())) for _ in range(N) ]
items.sort()
ans = 0
m = 0
for item in items:
  a = min(M - m, item[1])
  m += a
  ans += a * item[0]
print(ans)