• [D] Miku Needs More And More Fruits

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • After Miku getting some seeds of energy fruits,she begins planting them.Now there are n parts of lands,the size and yield of every land is same or different.
  • 输入
  • Input until EOF.
    For each test,there are two positive integers n(0<n<=10) and m(0<m<=10000) in the first line,n is the number of lands,m is the number of seeds.
    Then follows n lines,each line includes two positive integers a(0<a<=10000) is the maximum number of seeds that the land can be planted,b(0<b<=10000) is the number of fruits can a feed get.
  • 输出
  • For each test,please output the maximum number of fruits can Miku get.
  • 样例输入
  • 3 20
    5 8
    30 6
    10 7
    
  • 样例输出
  • 140
    
  • 提示
  • 来源
  • hungar
  • 操作

显示春菜