received candy grams from
his friend [REDACTED]! He has ~N~ individual candies, which he organized in order to eat 1 for the next ~N~ days such that each day has a specific associated candy. Each candy has a sweetness value of ~a_i~, and because [REDACTED] is sweet wishes to maximize the sweetness he eats over the ~N~ days. However, if eats a 2 candies in a row with a sum greater than ~K~, he will spontaneously combust. Thus, sometimes must skip eating candies on certain days in order to live. Please help !
The first line will contain ~N, K\ (1 \le N \le 2 \times 10^5),\ (1 \le K \le 10^9)~.
The next line will contain ~N~ integers ~a_i\ (1 \le a_i \le 10^9)~.
The maximum sweetness thatcan eat from the candies.
Subtask 1 [30%]
~N \le 2000~
Subtask 2 [70%]
No further constraints.
5 5 5 1 2 3 4
Alan eats the second, third, and fourth candies.