N,M=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(N)]
AB=sorted(AB)
cost=0
x=0
for ab in AB:
    if x+ab[1]<M:
        cost+=ab[0]*ab[1]
        x+=ab[1]
    else:
        cost+=ab[0]*(M-x)
        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 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=sorted(AB) AB sorted(AB) sorted AB cost=0 cost 0 x=0 x 0 for ab in AB:
    if x+ab[1]<M:
        cost+=ab[0]*ab[1]
        x+=ab[1]
    else:
        cost+=ab[0]*(M-x)
        break ab AB if x+ab[1]<M:
        cost+=ab[0]*ab[1]
        x+=ab[1]
    else:
        cost+=ab[0]*(M-x)
        break x+ab[1]<M x+ab[1] x ab[1] ab 1 M cost+=ab[0]*ab[1] cost ab[0]*ab[1] ab[0] ab 0 ab[1] ab 1 x+=ab[1] x ab[1] ab 1 cost+=ab[0]*(M-x) cost ab[0]*(M-x) ab[0] ab 0 M-x M x break print(cost) print cost M=map(int,input().split()) map(int,input().split()) M AB=[list(map(int,input().split())) for i in range(N)] [list(map(int,input().split())) for i in range(N)] AB cost+=ab[0]*ab[1] ab[0]*ab[1] cost x=0 0 x x+=ab[1] ab[1] x cost=0 0 cost N,M=map(int,input().split()) map(int,input().split()) N AB=sorted(AB) sorted(AB) AB cost+=ab[0]*(M-x) ab[0]*(M-x) cost
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(N)]
AB=sorted(AB)
cost=0
x=0
for ab in AB:
    if x+ab[1]<M:
        cost+=ab[0]*ab[1]
        x+=ab[1]
    else:
        cost+=ab[0]*(M-x)
        break
print(cost)
