Maximal Sum

No attempts yetTime limit1sMemory limit64 MB

Problem

A graph has rr nodes in a line, numbered 1 to rr. The edge joining node ii and node i+1i+1 has weight wiw_i, and a weight can be positive or negative.

For i<ji < j, the value of the path from node ii to node jj is the sum of the weights the path crosses, wi+wi+1++wj1w_i + w_{i+1} + \dots + w_{j-1}.

Write a program that finds the path with the largest value.

Input

The first line contains the number of test cases nn (1n1001 \le n \le 100).

Each test case starts with the number of nodes rr (2r502 \le r \le 50), followed by the integers w1,w2,,wr1w_1, w_2, \dots, w_{r-1}. Here wiw_i is the weight of the edge joining node ii and node i+1i+1, and 10000wi10000-10000 \le w_i \le 10000. Numbers are separated by whitespace or line breaks.

Output

For each test case, print on one line the starting node ii and the ending node jj of the path with the largest value, separated by a space.

If several paths reach the largest value, choose the longest one, the one whose jij-i is largest. If several paths share both the largest value and the same length, choose the one with the smallest ii.

If the largest value is not positive, print no good path.