• [G] Porter Cai

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • To feed TT, Mr. Cai have to be a porter to make some money.
    There're N goods need to be transported. Mr. Cai can take at most 2 goods at one time. But TT is distressed about Mr. Cai, she tell Mr. Cai that the goods' weight can't exceed W at each time.

    To finish his work as soon as possible, Mr. Cai wants to transport the goods in the minimum times.
    Can you tell Mr. Cai that the minimum times he should transport?
  • 输入
  • This problem contains several cases.
    The first line of each case contains two integers N and W. (1 <= N <= 10000, 1 <= W <= 10000)
    Then follows a line with N integers, indicate the weight of each goods. (Each weight is not exceed W)
  • 输出
  • For each case, print the minimum times Mr. Cai should take the goods.
  • 样例输入
  • 8 4
    2 2 2 2 2 2 2 2
    
  • 样例输出
  • 4
  • 提示
  • 来源
  • XadillaX
  • 操作

显示春菜