loop {
    n, m = gets.split.map &:to_i
    break if n == 0
    road = (1..n).map{ gets.split.map &:to_i }
    road.sort_by!(&:last).reverse!
    while !road.empty?
        if road[0][0] > m
            road[0][0] -= m
            break
        else
            m -= road[0][0]
            road.shift
        end
    end
    p road.map{|d, q| d * q}.inject(0, &:+)
}