Bad Packing

아직 제출이 없습니다시간 제한6초메모리 제한512 MB

문제

We have a knapsack of integral capacity and some objects of assorted integral sizes. We attempt to fill the knapsack up, but unfortunately, we are really bad at it, so we end up wasting a lot of space that can’t be further filled by any of the remaining objects. In fact, we are optimally bad at this! How bad can we possibly be?

Figure out the least capacity we can use where we cannot place any of the remaining objects in the knapsack. For example, suppose we have 33 objects with weights 33, 55 and 33, and our knapsack has capacity 66. If we foolishly pack the object with weight 55 first, we cannot place either of the other two objects in the knapsack. That’s the worst we can do, so 55 is the answer.

입력

The first line of input contains two integers nn (1n1,0001 \le n \le 1,000) and cc (1c1051 \le c \le 10^5), where nn is the number of objects we want to pack and cc is the capacity of the knapsack.

Each of the next nn lines contains a single integer ww (1wc1 \le w \le c). These are the weights of the objects.

출력

Output a single integer, which is the least capacity we can use where we cannot place any of the remaining objects in the knapsack.