N, M = list(map(lambda n: int(n), input().split(" ")))
E = []
for i in range(N):
  tmp = input().split(" ")
  E.append({
    "price": int(tmp[0]),
    "count": int(tmp[1])
  })

E.sort(key=lambda e: e["price"])

totP = 0
totC = 0
for i in range(len(E)):
  if totC + E[i]["count"] >= M:
    totP += (M - totC) * E[i]["price"]
    break
  else:
    totC += E[i]["count"]
    totP += E[i]["price"] * E[i]["count"]

print(totP) N, M = list(map(lambda n: int(n), input().split(" "))) N list(map(lambda n: int(n), input().split(" "))) list map(lambda n: int(n), input().split(" ")) map lambda n: int(n) int(n) int n n input().split(" ") ().split () input split " " M E = [] E [] for i in range(N):
  tmp = input().split(" ")
  E.append({
    "price": int(tmp[0]),
    "count": int(tmp[1])
  }) i range(N) range N tmp = input().split(" ") tmp input().split(" ") ().split () input split " " E.append({
    "price": int(tmp[0]),
    "count": int(tmp[1])
  }) E.append E append {
    "price": int(tmp[0]),
    "count": int(tmp[1])
  } "price" "price" int(tmp[0]) int tmp[0] tmp 0 "count" "count" int(tmp[1]) int tmp[1] tmp 1 E.sort(key=lambda e: e["price"]) E.sort E sort key=lambda e: e["price"] key lambda e: e["price"] e["price"] e "price" e totP = 0 totP 0 totC = 0 totC 0 for i in range(len(E)):
  if totC + E[i]["count"] >= M:
    totP += (M - totC) * E[i]["price"]
    break
  else:
    totC += E[i]["count"]
    totP += E[i]["price"] * E[i]["count"] i range(len(E)) range len(E) len E if totC + E[i]["count"] >= M:
    totP += (M - totC) * E[i]["price"]
    break
  else:
    totC += E[i]["count"]
    totP += E[i]["price"] * E[i]["count"] totC + E[i]["count"] >= M totC + E[i]["count"] totC E[i]["count"] [i] E i "count" M totP += (M - totC) * E[i]["price"] totP (M - totC) * E[i]["price"] M - totC M totC E[i]["price"] [i] E i "price" break totC += E[i]["count"] totC E[i]["count"] [i] E i "count" totP += E[i]["price"] * E[i]["count"] totP E[i]["price"] * E[i]["count"] E[i]["price"] [i] E i "price" E[i]["count"] [i] E i "count" print(totP) print totP E = [] [] E tmp = input().split(" ") input().split(" ") tmp N, M = list(map(lambda n: int(n), input().split(" "))) list(map(lambda n: int(n), input().split(" "))) N totP += (M - totC) * E[i]["price"] (M - totC) * E[i]["price"] totP totP = 0 0 totP totC = 0 0 totC totP += E[i]["price"] * E[i]["count"] E[i]["price"] * E[i]["count"] totP M = list(map(lambda n: int(n), input().split(" "))) list(map(lambda n: int(n), input().split(" "))) M totC += E[i]["count"] E[i]["count"] totC
N, M = list(map(lambda n: int(n), input().split(" ")))
E = []
for i in range(N):
  tmp = input().split(" ")
  E.append({
    "price": int(tmp[0]),
    "count": int(tmp[1])
  })

E.sort(key=lambda e: e["price"])

totP = 0
totC = 0
for i in range(len(E)):
  if totC + E[i]["count"] >= M:
    totP += (M - totC) * E[i]["price"]
    break
  else:
    totC += E[i]["count"]
    totP += E[i]["price"] * E[i]["count"]

print(totP)
