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