N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
AB = sorted(AB, key=lambda x:x[0])
ans = 0
for a, b in AB:
    if b <= M:
       ans += a * b
       M -= b
    else:
        ans += a * M
        break
    if M == 0:
        break
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 AB = [list(map(int, input().split())) for _ in range(N)] AB [list(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 ans = 0 ans 0 for a, b in AB:
    if b <= M:
       ans += a * b
       M -= b
    else:
        ans += a * M
        break
    if M == 0:
        break a b AB if b <= M:
       ans += a * b
       M -= b
    else:
        ans += a * M
        break
     b <= M b M ans += a * b ans a * b a b M -= b M b ans += a * M ans a * M a M break if M == 0:
        break M == 0 M 0 break print(ans) print ans ans = 0 0 ans AB = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] AB M = map(int, input().split()) map(int, input().split()) M M -= b b M N, M = map(int, input().split()) map(int, input().split()) N AB = sorted(AB, key=lambda x:x[0]) sorted(AB, key=lambda x:x[0]) AB ans += a * M a * M ans ans += a * b a * b ans
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
AB = sorted(AB, key=lambda x:x[0])
ans = 0
for a, b in AB:
    if b <= M:
       ans += a * b
       M -= b
    else:
        ans += a * M
        break
    if M == 0:
        break
print(ans)