MAXSUMSQ  Maximum Sum Sequences
Given an array A having n elements, let X be the maximum sum of any contiguous sequence in the array. How many contiguous sequences in A sum up to X?
Input
The first line contains T the number of test cases. There follow 2T lines, 2 for each test case. The first line contains the n, the number of elements in the array. The second line contains n space separated integers Ai.
Output
Output T lines, one for each test case. On each line, output two space separated integers; the maximum sequence sum, and the number of sequences which obtain this maximum sum.
Example
Input: 2
3
1 1 1
4
2 0 2 2 Output: 1 3
2 4
Constraints
1 <= T <= 35
1 <= n <= 100000
1000 <= Ai <= 1000
hide comments
trendbattles:
20230312 05:08:32
AC with map easily Last edit: 20230312 05:08:51 

black_shroud:
20200602 14:52:14
did it with BIT


anirudnits:
20190414 10:44:41
Some points:


gaurav1614:
20181102 07:55:21
Can anyone have a look at my code for this problem and tell what is wrong??


s_a_k_s_h_a_m:
20180310 08:31:39
use kadane's algo along with count array


ydeepak1889:
20170406 20:11:26
Finally AC after 4 WA and 2 TLE. 

pranay:
20170205 09:01:49
accepted using scanf and printf


Dushyant Singh:
20170203 23:09:05
map > TLE


scottt:
20161102 02:27:25
Use long long for "the number of sequences which obtains this maximum sum".


amr_aly:
20160820 06:05:41
@reddragon the first element only, the first and the second, the last element only, the whole array 
Added by:  Varun Jalan 
Date:  20100124 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: NODEJS OBJC PERL6 SQLITE VB.NET 
Resource:  own problem used for Codechef Snackdown Onsite 