n,m=map(int,input().split())
num=[]
for i in range(n):
    a,b=map(int,input().split())
    num.append([a,b])
str1= lambda val: val[0]
num.sort(key=str1)
numa=0
numb=0
for i in range(n):
    numa+=(num[i][1])*(num[i][0])
    numb+=num[i][1]
    if numb>=m:
        numa-=(numb-m)*num[i][0]
        break
print(numa) n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m num=[] num [] for i in range(n):
    a,b=map(int,input().split())
    num.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 num.append([a,b]) num.append num append [a,b] a b str1= lambda val: val[0] str1 lambda val: val[0] val[0] val 0 val num.sort(key=str1) num.sort num sort key=str1 key str1 numa=0 numa 0 numb=0 numb 0 for i in range(n):
    numa+=(num[i][1])*(num[i][0])
    numb+=num[i][1]
    if numb>=m:
        numa-=(numb-m)*num[i][0]
        break i range(n) range n numa+=(num[i][1])*(num[i][0]) numa (num[i][1])*(num[i][0]) num[i][1] [i] num i 1 num[i][0] [i] num i 0 numb+=num[i][1] numb num[i][1] [i] num i 1 if numb>=m:
        numa-=(numb-m)*num[i][0]
        break numb>=m numb m numa-=(numb-m)*num[i][0] numa (numb-m)*num[i][0] numb-m numb m num[i][0] [i] num i 0 break print(numa) print numa num=[] [] num numb+=num[i][1] num[i][1] numb str1= lambda val: val[0] lambda val: val[0] str1 n,m=map(int,input().split()) map(int,input().split()) n a,b=map(int,input().split()) map(int,input().split()) a numa=0 0 numa numa+=(num[i][1])*(num[i][0]) (num[i][1])*(num[i][0]) numa numb=0 0 numb b=map(int,input().split()) map(int,input().split()) b numa-=(numb-m)*num[i][0] (numb-m)*num[i][0] numa m=map(int,input().split()) map(int,input().split()) m
n,m=map(int,input().split())
num=[]
for i in range(n):
    a,b=map(int,input().split())
    num.append([a,b])
str1= lambda val: val[0]
num.sort(key=str1)
numa=0
numb=0
for i in range(n):
    numa+=(num[i][1])*(num[i][0])
    numb+=num[i][1]
    if numb>=m:
        numa-=(numb-m)*num[i][0]
        break
print(numa)
