N, M =map(int, input().split())
list1 = []
cost = 0
for i in range(N):
  A, B = map(int, input().split())
  list1.append((A, B))
list2 = sorted(list1, key= lambda x:x[0])
for i in range(N):
  if M >= list2[i][1]:
    M -= list2[i][1]
    cost += list2[i][0] * list2[i][1]
  else:
    break
cost += list2[i][0] * M
print(cost) N, M =map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M list1 = [] list1 [] cost = 0 cost 0 for i in range(N):
  A, B = map(int, input().split())
  list1.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 list1.append((A, B)) list1.append list1 append (A, B) A B list2 = sorted(list1, key= lambda x:x[0]) list2 sorted(list1, key= lambda x:x[0]) sorted list1 key= lambda x:x[0] key lambda x:x[0] x[0] x 0 x for i in range(N):
  if M >= list2[i][1]:
    M -= list2[i][1]
    cost += list2[i][0] * list2[i][1]
  else:
    break i range(N) range N if M >= list2[i][1]:
    M -= list2[i][1]
    cost += list2[i][0] * list2[i][1]
  else:
    break M >= list2[i][1] M list2[i][1] [i] list2 i 1 M -= list2[i][1] M list2[i][1] [i] list2 i 1 cost += list2[i][0] * list2[i][1] cost list2[i][0] * list2[i][1] list2[i][0] [i] list2 i 0 list2[i][1] [i] list2 i 1 break cost += list2[i][0] * M cost list2[i][0] * M list2[i][0] [i] list2 i 0 M print(cost) print cost A, B = map(int, input().split()) map(int, input().split()) A B = map(int, input().split()) map(int, input().split()) B cost += list2[i][0] * M list2[i][0] * M cost N, M =map(int, input().split()) map(int, input().split()) N list1 = [] [] list1 cost = 0 0 cost list2 = sorted(list1, key= lambda x:x[0]) sorted(list1, key= lambda x:x[0]) list2 cost += list2[i][0] * list2[i][1] list2[i][0] * list2[i][1] cost M =map(int, input().split()) map(int, input().split()) M M -= list2[i][1] list2[i][1] M
N, M =map(int, input().split())
list1 = []
cost = 0
for i in range(N):
  A, B = map(int, input().split())
  list1.append((A, B))
list2 = sorted(list1, key= lambda x:x[0])
for i in range(N):
  if M >= list2[i][1]:
    M -= list2[i][1]
    cost += list2[i][0] * list2[i][1]
  else:
    break
cost += list2[i][0] * M
print(cost)