SP5972 MAXSUMSQ - Maximum Sum Sequences
Description
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 Format
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 seperated integers Ai.
Output Format
Output T lines, one for each test case. On each line, output two space seperated integers; the maximum sequence sum, and the number of sequences which obtain this maximum sum.
Explanation/Hint
- $1 \le T \le 35$
- $1 \le n \le 10^5$
- $-10^3 \le a_i \le 10^3$