The score of a sequence s=s1,s2,…,sn is ∑i=1ni×si.
A contiguous subsequence is a sequence of its own, so the weights 1,2,3,… count again from its first term. The score of the contiguous subsequence sl,sl+1,…,sr is ∑i=lr(i−l+1)×si.
Write a program that finds the largest score among the contiguous subsequences of s. A subsequence of length 0 can be chosen, and its score is 0.