Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence
is defined to be { Ni, Ni+1, ..., Nj } where 1 <= i <= j <= K. The Maximum
Subsequence is the continuous subsequence which has the largest sumof its
elements. For example, given sequence { -2, 11, -4, 13, -5, -2 }, its maximum
subsequence is { 11, -4, 13 } withthe largest sum being 20.
Now you are supposed to find the largest sum, together withthefirstandthelast numbers ofthe maximum subsequence.
Input Specification:
Each input filecontainsone test case. Each case occupies twolines. The
firstlinecontainsa positive integer K (<= 10000). The secondlinecontains
K numbers, separated byaspace.
Output Specification:
For each test case, output inonelinethe largest sum, together withthefirstandthelast numbers ofthe maximum subsequence. The numbers m