StatementStatement languageEnglish한국어 English한국어EnglishYou are given a sequence A=[A1,A2,⋯ ,AN]A=[A_1,A_2,\cdots,A_N]A=[A1,A2,⋯,AN] of length NNN. Find the maximum value of ∑i=lrAi(1≤l≤r≤N).\sum_{i=l}^{r} A_i \qquad (1\leq l\leq r\leq N).i=l∑rAi(1≤InputThe input is given in the following format:TTT case1\mathrm{case}_1case1 case2\mathrm{case}_2case OutputFor each case, print the maximum value on its own line.Constraints 1≤T≤100 0001\leq T\leq100\,0001≤T≤100000. 1≤N≤1061\leq N\leq10^61≤N≤10. Subtasks#ScoreConstraints120N≤500N\leq500N≤500, and the sum of NNN over all cases is at most 500500500.230N≤5000N\leq5000N≤, and the sum of over all cases is at most .SamplesInputCopy4 5 1 -2 3 4 -1 3 -5 -2 -7 4 0 0 0 0 4 1 2 3 4OutputCopy7 -2 0 10Show tags