#Lutece0600. 数的划分

数的划分

Migrated from Lutece 600 数的划分

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

给定NN个数,把他们划分成最少的部分,使得每部分之和小于某个定值MM

Input

输入由不超过100100组输入数据组成。

每组数据由给出NNMM的一行开始。NN不超过1818MM不超过10000000001000000000

接下里NN行每行一个数,每个数不超过MM

Output

对于每组数据,先输出Case T: ,其中TT是数据的编号(从11开始)。

然后输出把这NN个数划分成的最少部分。

Samples

1
3 3
1 3 2
Case 1: 2

Resources

UESTC Training for Dynamic Programming