n,m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort()
money = 0
drink = 0
for a,b in ab:
    if drink+b <= m:
        drink += b
        money += a*b
    else:
        money += (m-drink) * a
        drink = m
    if drink == 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)] ab.sort() ab.sort ab sort money = 0 money 0 drink = 0 drink 0 for a,b in ab:
    if drink+b <= m:
        drink += b
        money += a*b
    else:
        money += (m-drink) * a
        drink = m
    if drink == m: break a b ab if drink+b <= m:
        drink += b
        money += a*b
    else:
        money += (m-drink) * a
        drink = m
     drink+b <= m drink+b drink b m drink += b drink b money += a*b money a*b a b money += (m-drink) * a money (m-drink) * a m-drink m drink a drink = m drink m if drink == m: b drink == m drink m print(money) print money ab = [list(map(int, input().split())) for _ in range(n)] [list(map(int, input().split())) for _ in range(n)] ab money += (m-drink) * a (m-drink) * a money n,m = map(int, input().split()) map(int, input().split()) n drink += b b drink money += a*b a*b money m = map(int, input().split()) map(int, input().split()) m money = 0 0 money drink = 0 0 drink drink = m m drink
n,m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort()
money = 0
drink = 0
for a,b in ab:
    if drink+b <= m:
        drink += b
        money += a*b
    else:
        money += (m-drink) * a
        drink = m
    if drink == m: break
print(money)