n,m = map(int,input().split())
s = []
ans = 0
for i in range(n):
    a,b = map(int,input().split())
    s.append([a,b])
s.sort()
for i in s:
    if m<i[1]:
        ans += m*i[0]
        break
    else:
        ans += i[0]*i[1]
        m -= i[1]
print(ans) n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m s = [] s [] ans = 0 ans 0 for i in range(n):
    a,b = map(int,input().split())
    s.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 s.append([a,b]) s.append s append [a,b] a b s.sort() s.sort s sort for i in s:
    if m<i[1]:
        ans += m*i[0]
        break
    else:
        ans += i[0]*i[1]
        m -= i[1] i s if m<i[1]:
        ans += m*i[0]
        break
    else:
        ans += i[0]*i[1]
        m -= i[1] m<i[1] m i[1] i 1 ans += m*i[0] ans m*i[0] m i[0] i 0 break ans += i[0]*i[1] ans i[0]*i[1] i[0] i 0 i[1] i 1 m -= i[1] m i[1] i 1 print(ans) print ans m = map(int,input().split()) map(int,input().split()) m ans += m*i[0] m*i[0] ans b = map(int,input().split()) map(int,input().split()) b ans += i[0]*i[1] i[0]*i[1] ans n,m = map(int,input().split()) map(int,input().split()) n a,b = map(int,input().split()) map(int,input().split()) a ans = 0 0 ans m -= i[1] i[1] m s = [] [] s
n,m = map(int,input().split())
s = []
ans = 0
for i in range(n):
    a,b = map(int,input().split())
    s.append([a,b])
s.sort()
for i in s:
    if m<i[1]:
        ans += m*i[0]
        break
    else:
        ans += i[0]*i[1]
        m -= i[1]
print(ans)
