S,the person who made the question wants to know the top
Give you n n numbers a_i a i , define S_{(l, r)}=sumlimits_{i=l}^r a_i (1 leq l leq r leq n) S (l,r) = i=l ∑ r a i (1≤l≤r≤n), obviously There are dfrac{n times (n+ 1)}{2} S 2 n×(n+1) S,the person who made the question wants to know the top w S wS.
(图片来源网络,侵删)