N, M = map(int, input().split())

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

Z.sort(key=lambda x:x[0])

count = 0
cost = 0
shop = 0
while count < M:
  buy = min(Z[shop][1], M - count)
  count += buy
  cost +=  buy * Z[shop][0]
  if count < M:
    shop += 1
  
print(cost) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M Z = [] Z [] for i in range(N):
  a, b = map(int, input().split())
  Z.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 Z.append((a, b)) Z.append Z append (a, b) a b Z.sort(key=lambda x:x[0]) Z.sort Z sort key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x count = 0 count 0 cost = 0 cost 0 shop = 0 shop 0 while count < M:
  buy = min(Z[shop][1], M - count)
  count += buy
  cost +=  buy * Z[shop][0]
  if count < M:
    shop += 1
   count < M count M buy = min(Z[shop][1], M - count) buy min(Z[shop][1], M - count) min Z[shop][1] [shop] Z shop 1 M - count M count count += buy count buy cost +=  buy * Z[shop][0] cost buy * Z[shop][0] buy Z[shop][0] [shop] Z shop 0 if count < M:
    shop += 1
   count < M count M shop += 1 shop 1 print(cost) print cost cost +=  buy * Z[shop][0] buy * Z[shop][0] cost cost = 0 0 cost buy = min(Z[shop][1], M - count) min(Z[shop][1], M - count) buy count += buy buy count shop = 0 0 shop N, M = map(int, input().split()) map(int, input().split()) N Z = [] [] Z shop += 1 1 shop a, b = map(int, input().split()) map(int, input().split()) a count = 0 0 count 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())

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

Z.sort(key=lambda x:x[0])

count = 0
cost = 0
shop = 0
while count < M:
  buy = min(Z[shop][1], M - count)
  count += buy
  cost +=  buy * Z[shop][0]
  if count < M:
    shop += 1
  
print(cost)