N, M = map(int, input().split())
C = []
for _ in range(N):
    A, B = map(int, input().split())
    C.append((A,B))
C.sort()
cnt = 0
res = 0
for i in range(N):
    if cnt+C[i][1]<=M:
        res += C[i][1]*C[i][0]
        cnt += C[i][1]
    else:
        break
print((M-cnt)*C[i][0] + res) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M C = [] C [] for _ in range(N):
    A, B = map(int, input().split())
    C.append((A,B)) _ range(N) range N A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B C.append((A,B)) C.append C append (A,B) A B C.sort() C.sort C sort cnt = 0 cnt 0 res = 0 res 0 for i in range(N):
    if cnt+C[i][1]<=M:
        res += C[i][1]*C[i][0]
        cnt += C[i][1]
    else:
        break i range(N) range N if cnt+C[i][1]<=M:
        res += C[i][1]*C[i][0]
        cnt += C[i][1]
    else:
        break cnt+C[i][1]<=M cnt+C[i][1] cnt C[i][1] [i] C i 1 M res += C[i][1]*C[i][0] res C[i][1]*C[i][0] C[i][1] [i] C i 1 C[i][0] [i] C i 0 cnt += C[i][1] cnt C[i][1] [i] C i 1 break print((M-cnt)*C[i][0] + res) print (M-cnt)*C[i][0] + res (M-cnt)*C[i][0] M-cnt M cnt C[i][0] [i] C i 0 res res += C[i][1]*C[i][0] C[i][1]*C[i][0] res N, M = map(int, input().split()) map(int, input().split()) N cnt = 0 0 cnt res = 0 0 res cnt += C[i][1] C[i][1] cnt A, B = map(int, input().split()) map(int, input().split()) A B = map(int, input().split()) map(int, input().split()) B C = [] [] C M = map(int, input().split()) map(int, input().split()) M
N, M = map(int, input().split())
C = []
for _ in range(N):
    A, B = map(int, input().split())
    C.append((A,B))
C.sort()
cnt = 0
res = 0
for i in range(N):
    if cnt+C[i][1]<=M:
        res += C[i][1]*C[i][0]
        cnt += C[i][1]
    else:
        break
print((M-cnt)*C[i][0] + res)