N, M = map(int, input().split())
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB = sorted(AB, key=lambda x: x[0])
r = 0
for a, b in AB:
    if M <= 0:
        break
    if b <= M:
        r += a*b
        M -= b
    elif b >= M:
        r += a*M
        break
print(r) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M tuple(map(int, input().split())) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split AB = [tuple(map(int, input().split())) for _ in range(N)] AB [tuple(map(int, input().split())) for _ in range(N)] AB = sorted(AB, key=lambda x: x[0]) AB sorted(AB, key=lambda x: x[0]) sorted AB key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x r = 0 r 0 for a, b in AB:
    if M <= 0:
        break
    if b <= M:
        r += a*b
        M -= b
    elif b >= M:
        r += a*M
        break a b AB if M <= 0:
        break
     M <= 0 M 0 break if b <= M:
        r += a*b
        M -= b
    elif b >= M:
        r += a*M
        break b <= M b M r += a*b r a*b a b M -= b M b elif b >= M:
        r += a*M
        break b >= M b M r += a*M r a*M a M break print(r) print r AB = sorted(AB, key=lambda x: x[0]) sorted(AB, key=lambda x: x[0]) AB N, M = map(int, input().split()) map(int, input().split()) N r += a*M a*M r AB = [tuple(map(int, input().split())) for _ in range(N)] [tuple(map(int, input().split())) for _ in range(N)] AB r = 0 0 r M = map(int, input().split()) map(int, input().split()) M r += a*b a*b r M -= b b M
N, M = map(int, input().split())
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB = sorted(AB, key=lambda x: x[0])
r = 0
for a, b in AB:
    if M <= 0:
        break
    if b <= M:
        r += a*b
        M -= b
    elif b >= M:
        r += a*M
        break
print(r)
