N, M= map(int, input().split())
A = []
for i in range(N):
  A.append(list(map(int, input().split())))
A.sort()
ans = 0
for i in range(N):
  if A[i][1] < M:
    ans += A[i][0] * A[i][1]
    M -= A[i][1]
  else:
    ans += A[i][0] * M
    break
print(ans) N, M= map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M A = [] A [] for i in range(N):
  A.append(list(map(int, input().split()))) i range(N) range N A.append(list(map(int, input().split()))) A.append A append list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split A.sort() A.sort A sort ans = 0 ans 0 for i in range(N):
  if A[i][1] < M:
    ans += A[i][0] * A[i][1]
    M -= A[i][1]
  else:
    ans += A[i][0] * M
    break i range(N) range N if A[i][1] < M:
    ans += A[i][0] * A[i][1]
    M -= A[i][1]
  else:
    ans += A[i][0] * M
    break A[i][1] < M A[i][1] [i] A i 1 M ans += A[i][0] * A[i][1] ans A[i][0] * A[i][1] A[i][0] [i] A i 0 A[i][1] [i] A i 1 M -= A[i][1] M A[i][1] [i] A i 1 ans += A[i][0] * M ans A[i][0] * M A[i][0] [i] A i 0 M break print(ans) print ans A = [] [] A M -= A[i][1] A[i][1] M ans += A[i][0] * M A[i][0] * M ans ans += A[i][0] * A[i][1] A[i][0] * A[i][1] ans N, M= map(int, input().split()) map(int, input().split()) N M= map(int, input().split()) map(int, input().split()) M ans = 0 0 ans
N, M= map(int, input().split())
A = []
for i in range(N):
  A.append(list(map(int, input().split())))
A.sort()
ans = 0
for i in range(N):
  if A[i][1] < M:
    ans += A[i][0] * A[i][1]
    M -= A[i][1]
  else:
    ans += A[i][0] * M
    break
print(ans)