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