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