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

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

AB.sort(key=lambda x : x[0])
ans = 0
for AB in AB:
    if M <= AB[1]:
        ans += M * AB[0]
        break
    else:
        ans += AB[0] * AB[1]
        M -= AB[1]
print(ans)