N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
# 単価が安い順に店を並べる
sorted_AB = sorted(AB, key=lambda x: x[0])

money = 0
cnt = 0
for a, b in sorted_AB:
    tmp = min(b, M - cnt)
    cnt += tmp
    money += a * tmp
    if cnt == M:
        break
print(money) 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 AB = [list(map(int, input().split())) for _ in range(N)] AB [list(map(int, input().split())) for _ in range(N)] sorted_AB = sorted(AB, key=lambda x: x[0]) sorted_AB sorted(AB, key=lambda x: x[0]) sorted AB key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x money = 0 money 0 cnt = 0 cnt 0 for a, b in sorted_AB:
    tmp = min(b, M - cnt)
    cnt += tmp
    money += a * tmp
    if cnt == M:
        break a b sorted_AB tmp = min(b, M - cnt) tmp min(b, M - cnt) min b M - cnt M cnt cnt += tmp cnt tmp money += a * tmp money a * tmp a tmp if cnt == M:
        break cnt == M cnt M break print(money) print money money += a * tmp a * tmp money cnt += tmp tmp cnt AB = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] AB cnt = 0 0 cnt sorted_AB = sorted(AB, key=lambda x: x[0]) sorted(AB, key=lambda x: x[0]) sorted_AB M = map(int, input().split()) map(int, input().split()) M N, M = map(int, input().split()) map(int, input().split()) N tmp = min(b, M - cnt) min(b, M - cnt) tmp money = 0 0 money
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
# 単価が安い順に店を並べる
sorted_AB = sorted(AB, key=lambda x: x[0])

money = 0
cnt = 0
for a, b in sorted_AB:
    tmp = min(b, M - cnt)
    cnt += tmp
    money += a * tmp
    if cnt == M:
        break
print(money)
