N, M = map(int, input().split())
D = [list(map(int,input().split())) for i in range(N)]

D.sort()
ans = 0

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

D.sort()
ans = 0

while M > 0:
    for i in D:
        if i[1] >= M:
            ans += M*i[0]
            M = 0
        else:
            ans += i[1]*i[0]
            M -= i[1]

print(ans)