It is now late in May and Amy¡¯s 20 years birthday is coming soon. ¡°I¡¯m gonna to prepare
some presents for her because it is really a special day¡±, Ray says to himself. Then he
comes to a stone shop which provided different colorful stones in a line. There are N
stones in the shop and each stone has a value. Known all the things, Boss Chen tells
Ray that ¡°you can choose one or more consecutive stones among all of them and they
will be free for you¡±. Ray wants to get the Kth sequence among all the available choices
after sorted in ascending order. The value of a consecutive sequence is the sum of the
value in this sequence. Why does Ray prefer the Kth sequence to the first? He knows
exactly that K is Amy¡¯s lucky number.
The input file contains multiple test cases. Every test case begins with two positive
integers N (1<=N<=20000) and K(1<=K<=(N+1)*N/2) indicating the number of stones and
Amy¡¯s lucky number. Then comes N lines, the i+1 line will be the value of the ith
stone. You may assume that the value of any sequence will be fit into a 32-bit signed
Integer. Proceed to the end of the file.
For each case, output an integer indicating the total value of Ray¡¯s choice.
Please output as the format in the Sample Output.
Case 1: 1
Case 2: 15