N, M = map(int, input().split())
S = [list(map(int, input().split())) for i in range(N)]
S.sort()
ans = 0
k = M
for i in range(N):
  if k == 0:
    break
  elif S[i][1] <= k:
    k -= S[i][1]
    ans += S[i][0] * S[i][1]
  else:
    ans += S[i][0] * k
    k = 0
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 i in range(N) for i in range(N) i range(N) range N for i in range(N) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split S = [list(map(int, input().split())) for i in range(N)] S [list(map(int, input().split())) for i in range(N)] S.sort() S.sort S sort ans = 0 ans 0 k = M k M for i in range(N):
  if k == 0:
    break
  elif S[i][1] <= k:
    k -= S[i][1]
    ans += S[i][0] * S[i][1]
  else:
    ans += S[i][0] * k
    k = 0 i range(N) range N if k == 0:
    break
  elif S[i][1] <= k:
    k -= S[i][1]
    ans += S[i][0] * S[i][1]
  else:
    ans += S[i][0] * k
    k = 0 k == 0 k 0 break elif S[i][1] <= k:
    k -= S[i][1]
    ans += S[i][0] * S[i][1]
   S[i][1] <= k S[i][1] [i] S i 1 k k -= S[i][1] k S[i][1] [i] S i 1 ans += S[i][0] * S[i][1] ans S[i][0] * S[i][1] S[i][0] [i] S i 0 S[i][1] [i] S i 1 ans += S[i][0] * k ans S[i][0] * k S[i][0] [i] S i 0 k k = 0 k 0 print(ans) print ans S = [list(map(int, input().split())) for i in range(N)] [list(map(int, input().split())) for i in range(N)] S k = 0 0 k k -= S[i][1] S[i][1] k M = map(int, input().split()) map(int, input().split()) M ans += S[i][0] * S[i][1] S[i][0] * S[i][1] ans N, M = map(int, input().split()) map(int, input().split()) N k = M M k ans = 0 0 ans ans += S[i][0] * k S[i][0] * k ans
N, M = map(int, input().split())
S = [list(map(int, input().split())) for i in range(N)]
S.sort()
ans = 0
k = M
for i in range(N):
  if k == 0:
    break
  elif S[i][1] <= k:
    k -= S[i][1]
    ans += S[i][0] * S[i][1]
  else:
    ans += S[i][0] * k
    k = 0
print(ans)