N,M = map(int,input().split())
shops = [list(map(int,input().split())) for i in range(N)]
shops.sort()
get = 0
money = 0
for i in range(0,N,1):
    if get == M:
        break
    tmp_buy = min(M-get,shops[i][1])
    get += tmp_buy
    money += tmp_buy*(shops[i][0])
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 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 shops = [list(map(int,input().split())) for i in range(N)] shops [list(map(int,input().split())) for i in range(N)] shops.sort() shops.sort shops sort get = 0 get 0 money = 0 money 0 for i in range(0,N,1):
    if get == M:
        break
    tmp_buy = min(M-get,shops[i][1])
    get += tmp_buy
    money += tmp_buy*(shops[i][0]) i range(0,N,1) range 0 N 1 if get == M:
        break
     get == M get M break tmp_buy = min(M-get,shops[i][1]) tmp_buy min(M-get,shops[i][1]) min M-get M get shops[i][1] [i] shops i 1 get += tmp_buy get tmp_buy money += tmp_buy*(shops[i][0]) money tmp_buy*(shops[i][0]) tmp_buy shops[i][0] [i] shops i 0 print(money) print money M = map(int,input().split()) map(int,input().split()) M N,M = map(int,input().split()) map(int,input().split()) N tmp_buy = min(M-get,shops[i][1]) min(M-get,shops[i][1]) tmp_buy get += tmp_buy tmp_buy get money += tmp_buy*(shops[i][0]) tmp_buy*(shops[i][0]) money money = 0 0 money shops = [list(map(int,input().split())) for i in range(N)] [list(map(int,input().split())) for i in range(N)] shops get = 0 0 get
N,M = map(int,input().split())
shops = [list(map(int,input().split())) for i in range(N)]
shops.sort()
get = 0
money = 0
for i in range(0,N,1):
    if get == M:
        break
    tmp_buy = min(M-get,shops[i][1])
    get += tmp_buy
    money += tmp_buy*(shops[i][0])
print(money)
