n, m = map(int, input().split())
stores = [list(map(int, input().split())) for _ in range(n)]
sorted_sotres = sorted(stores, key=lambda x: x[0])
total = 0
ans = 0
for cost, number in sorted_sotres:
    if number > m:
        ans += cost * m
        break
    elif number == m:
        ans += cost * number
        break
    else:
        ans += cost * number
    m -= number
print(ans) 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 stores = [list(map(int, input().split())) for _ in range(n)] stores [list(map(int, input().split())) for _ in range(n)] sorted_sotres = sorted(stores, key=lambda x: x[0]) sorted_sotres sorted(stores, key=lambda x: x[0]) sorted stores key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x total = 0 total 0 ans = 0 ans 0 for cost, number in sorted_sotres:
    if number > m:
        ans += cost * m
        break
    elif number == m:
        ans += cost * number
        break
    else:
        ans += cost * number
    m -= number cost number sorted_sotres if number > m:
        ans += cost * m
        break
    elif number == m:
        ans += cost * number
        break
    else:
        ans += cost * number
     number > m number m ans += cost * m ans cost * m cost m break elif number == m:
        ans += cost * number
        break
     number == m number m ans += cost * number ans cost * number cost number break ans += cost * number ans cost * number cost number m -= number m number print(ans) print ans total = 0 0 total m -= number number m m = map(int, input().split()) map(int, input().split()) m ans += cost * m cost * m ans ans = 0 0 ans ans += cost * number cost * number ans ans += cost * number cost * number ans stores = [list(map(int, input().split())) for _ in range(n)] [list(map(int, input().split())) for _ in range(n)] stores n, m = map(int, input().split()) map(int, input().split()) n sorted_sotres = sorted(stores, key=lambda x: x[0]) sorted(stores, key=lambda x: x[0]) sorted_sotres
n, m = map(int, input().split())
stores = [list(map(int, input().split())) for _ in range(n)]
sorted_sotres = sorted(stores, key=lambda x: x[0])
total = 0
ans = 0
for cost, number in sorted_sotres:
    if number > m:
        ans += cost * m
        break
    elif number == m:
        ans += cost * number
        break
    else:
        ans += cost * number
    m -= number
print(ans)
