Panik has a large chocolate bar with N linearly connected pieces.
Each piece has its own chocolate value Ai. His friend Priyam keeps on making cuts on his chocolate bar and asks him to pick the connected component of the chocolate with the maximum chocolate content.
The chocolate content of a connected component is the sum of all the chocolate value of the pieces lying in the connected component.
Since the task is too difficult for him, Panik wants you to help him pick the connected component of the chocolate with maximum chocolate content after every cut.
INPUT
OUTPUT
Print K lines, each line containing chocolate content of the component having the maximum chocolate content out of all available components after the ith cut.
CONSTRAINTS
Initially, the chocolate had 5 pieces with values 4,5,6,7,8. After the first cut, the chocolate is divided into 2 parts. The first component will have chocolate value of 4 and the second component will have chocolate value of 5+6+7+8 i.e. 26. After the second cut, the chocolate is divided into 3 components. The first component will have chocolate value of 4, the second component will have chocolate value of 5+6 11, the third component will have chocolate value of 7+8 i.e 15.
Figure out the rest of the answers