N, M = list(map(int, input().split()))

x = sorted([list(map(int, input().split())) for i in range(N)])

i = 0

minprice = x[i][0]

minnumber = x[i][1]

price = 0

while True:

    if M <= minnumber:

        price += minprice * M

        break

    else:

        price += minprice * minnumber

        M -= minnumber

        i += 1

        minprice = x[i][0]

        minnumber = x[i][1]

print(price)
N, M = list(map(int, input().split()))

x = sorted([list(map(int, input().split())) for i in range(N)])

i = 0

price = 0

minprice = x[i][0]

minnumber = x[i][1]

while True:

    if minnumber >= M:

        price += minprice*M

        break

    else:

        price += minprice * minnumber

        M -= minnumber

        i += 1

        minprice = x[i][0]

        minnumber = x[i][1]

print(price)
N, M = list(map(int, input().split()))
x = sorted([list(map(int, input().split())) for i in range(N)])
i = 0
minprice = x[i][0]
minnumber = x[i][1]
price = 0
while True:
    if M <= minnumber:
        price += minprice * M
        break
    else:
        price += minprice * minnumber
        M -= minnumber
        i += 1
        minprice = x[i][0]
        minnumber = x[i][1]
print(price)

N, M = list(map(int, input().split()))
x = sorted([list(map(int, input().split())) for i in range(N)])
i = 0
price = 0
minprice = x[i][0]
minnumber = x[i][1]
while True:
    if minnumber >= M:
        price += minprice * M
        break
    else:
        price += minprice * minnumber
        M -= minnumber
        i += 1
        minprice = x[i][0]
        minnumber = x[i][1]
print(price)

+price = 0 -price = 0 -    if M <= minnumber: +    if minnumber >= M: