N, M = map(int, input().split())
pAc = [list(map(int, input().split())) for _ in range(N)]
pAc.sort()
count = 0
price = 0
for p,c in pAc:
    if count + c >= M:
        print(price+(M-count)*p)
        exit()
    count += c
    price += p*c

 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 pAc = [list(map(int, input().split())) for _ in range(N)] pAc [list(map(int, input().split())) for _ in range(N)] pAc.sort() pAc.sort pAc sort count = 0 count 0 price = 0 price 0 for p,c in pAc:
    if count + c >= M:
        print(price+(M-count)*p)
        exit()
    count += c
    price += p*c p c pAc if count + c >= M:
        print(price+(M-count)*p)
        exit()
     count + c >= M count + c count c M print(price+(M-count)*p) print price+(M-count)*p price (M-count)*p M-count M count p exit() exit count += c count c price += p*c price p*c p c price += p*c p*c price count += c c count M = map(int, input().split()) map(int, input().split()) M price = 0 0 price pAc = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] pAc count = 0 0 count N, M = map(int, input().split()) map(int, input().split()) N
N, M = map(int, input().split())
pAc = [list(map(int, input().split())) for _ in range(N)]
pAc.sort()
count = 0
price = 0
for p,c in pAc:
    if count + c >= M:
        print(price+(M-count)*p)
        exit()
    count += c
    price += p*c


