n,m = map(int,input().split())
L = [list(map(int,input().split())) for _ in range(n)]
L = sorted(L, key=lambda x: x[0])
limit = m
ans = 0
for i in range(n):
  if limit <= 0: break
  ans += min(limit, L[i][1]) * L[i][0]
  limit -= L[i][1]
print(ans) n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m list(map(int,input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split L = [list(map(int,input().split())) for _ in range(n)] L [list(map(int,input().split())) for _ in range(n)] L = sorted(L, key=lambda x: x[0]) L sorted(L, key=lambda x: x[0]) sorted L key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x limit = m limit m ans = 0 ans 0 for i in range(n):
  if limit <= 0: break
  ans += min(limit, L[i][1]) * L[i][0]
  limit -= L[i][1] i range(n) range n if limit <= 0: break
   limit <= 0 limit 0 ans += min(limit, L[i][1]) * L[i][0] ans min(limit, L[i][1]) * L[i][0] min(limit, L[i][1]) min limit L[i][1] [i] L i 1 L[i][0] [i] L i 0 limit -= L[i][1] limit L[i][1] [i] L i 1 print(ans) print ans m = map(int,input().split()) map(int,input().split()) m limit = m m limit n,m = map(int,input().split()) map(int,input().split()) n ans = 0 0 ans ans += min(limit, L[i][1]) * L[i][0] min(limit, L[i][1]) * L[i][0] ans limit -= L[i][1] L[i][1] limit L = [list(map(int,input().split())) for _ in range(n)] [list(map(int,input().split())) for _ in range(n)] L L = sorted(L, key=lambda x: x[0]) sorted(L, key=lambda x: x[0]) L
n,m = map(int,input().split())
L = [list(map(int,input().split())) for _ in range(n)]
L = sorted(L, key=lambda x: x[0])
limit = m
ans = 0
for i in range(n):
  if limit <= 0: break
  ans += min(limit, L[i][1]) * L[i][0]
  limit -= L[i][1]
print(ans)