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