N,M = map(int,input().split())
A = sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[0])
ans = 0
tot = 0
for i in range(N):
    a,b = A[i]
    if tot+b<M:
        tot += b
        ans += a*b
    else:
        n = M-tot
        ans += a*n
        break
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 A = sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[0]) A sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[0]) sorted [list(map(int,input().split())) for _ in range(N)] key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x ans = 0 ans 0 tot = 0 tot 0 for i in range(N):
    a,b = A[i]
    if tot+b<M:
        tot += b
        ans += a*b
    else:
        n = M-tot
        ans += a*n
        break i range(N) range N a,b = A[i] a A[i] A i b if tot+b<M:
        tot += b
        ans += a*b
    else:
        n = M-tot
        ans += a*n
        break tot+b<M tot+b tot b M tot += b tot b ans += a*b ans a*b a b n = M-tot n M-tot M tot ans += a*n ans a*n a n break print(ans) print ans M = map(int,input().split()) map(int,input().split()) M n = M-tot M-tot n ans += a*b a*b ans b = A[i] A[i] b a,b = A[i] A[i] a N,M = map(int,input().split()) map(int,input().split()) N tot = 0 0 tot ans += a*n a*n ans tot += b b tot ans = 0 0 ans A = sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[0]) sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[0]) A
N,M = map(int,input().split())
A = sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[0])
ans = 0
tot = 0
for i in range(N):
    a,b = A[i]
    if tot+b<M:
        tot += b
        ans += a*b
    else:
        n = M-tot
        ans += a*n
        break
print(ans)