while true
  n,m = gets.split(" ").map{|str| str.to_i}
  break if [n,m] == [0,0]
  pd = Array.new(n){gets.split(" ").map{|str| str.to_i}.reverse}.sort #??±????????§????????????????????£????????§reverse?????????

  attack = pd.inject(0){|sum,arr| sum += arr.inject(:*)}

  while m>0
    attack -= pd[-1][0]
    m -= 1 ; pd[-1][1] -= 1
    pd.pop if pd[-1][1] == 0
  end

  puts attack
end