n,m = map(int,input().split())
energy = []
for i in range(n):
    a,b = map(int,input().split())
    energy.append([a,b])

energy.sort(key=lambda x:x[0])

money = 0

for i in range(n):
    if energy[i][1] < m:
        m -= energy[i][1]
        money += energy[i][1] * energy[i][0]
    else:
        money += energy[i][0] * m
        break
print(money) n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m energy = [] energy [] for i in range(n):
    a,b = map(int,input().split())
    energy.append([a,b]) i range(n) range n a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b energy.append([a,b]) energy.append energy append [a,b] a b energy.sort(key=lambda x:x[0]) energy.sort energy sort key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x money = 0 money 0 for i in range(n):
    if energy[i][1] < m:
        m -= energy[i][1]
        money += energy[i][1] * energy[i][0]
    else:
        money += energy[i][0] * m
        break i range(n) range n if energy[i][1] < m:
        m -= energy[i][1]
        money += energy[i][1] * energy[i][0]
    else:
        money += energy[i][0] * m
        break energy[i][1] < m energy[i][1] [i] energy i 1 m m -= energy[i][1] m energy[i][1] [i] energy i 1 money += energy[i][1] * energy[i][0] money energy[i][1] * energy[i][0] energy[i][1] [i] energy i 1 energy[i][0] [i] energy i 0 money += energy[i][0] * m money energy[i][0] * m energy[i][0] [i] energy i 0 m break print(money) print money energy = [] [] energy n,m = map(int,input().split()) map(int,input().split()) n m -= energy[i][1] energy[i][1] m money = 0 0 money a,b = map(int,input().split()) map(int,input().split()) a b = map(int,input().split()) map(int,input().split()) b m = map(int,input().split()) map(int,input().split()) m money += energy[i][1] * energy[i][0] energy[i][1] * energy[i][0] money money += energy[i][0] * m energy[i][0] * m money
n,m = map(int,input().split())
energy = []
for i in range(n):
    a,b = map(int,input().split())
    energy.append([a,b])

energy.sort(key=lambda x:x[0])

money = 0

for i in range(n):
    if energy[i][1] < m:
        m -= energy[i][1]
        money += energy[i][1] * energy[i][0]
    else:
        money += energy[i][0] * m
        break
print(money)