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