Ripul was skilled in the art of lapidary. He used to collect stones and convert it into decorative items for sale.  There were n stone shops. Each shop was having one exclusive stone of value s[i] , where 1<=i<=n.  If number of stones collected are more than 1, then total value will be product of values of all the stones he collected. Ripul wants to have maximum value of stones he collected. Help Ripul in picking up the subarray which leads to maximum value of stones he collected.

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- The first line of each testcase contains an integer $N$, denoting number of elements in the given array.
- The second line contains $N$ space-separated integers $S1$, $S2$, …, $SN$ denoting the value of stone in each shop. 

-----Output:-----
For each testcase, output the maximum value of stones possible, the starting index and ending index of the chosen subarray (0-based indexing). If there are multiple subarrays with same value, print the one with greater starting index. If there are multiple answer subarrays with same starting index, print the one with greater ending index. (The answer will fit in 64 bit binary number).

-----Constraints-----
- $1 \leq T \leq 10$
- $1 \leq N \leq 10^5$
- $-100 \leq S[i] \leq 100$

-----Subtasks-----
- 30 points : $1 \leq N \leq 10^3$
- 70 points : $1 \leq N \leq 10^5$

-----Sample Input:-----
1
3

1 2 3

-----Sample Output:-----
6 1 2

-----EXPLANATION:-----
If Ripul collects all the all the three gems, total value will be 6 (1 * 2 * 3).
If Ripul collects last two gems, total value will be 6 (1 * 2 * 3).
So, he picks the subarray with greater starting index.

Difficulty: interview

Starter code:

Solutions:
# cook your dish here
for u in range(int(input())):
 n=int(input())
 l=list(map(int,input().split()))
 d=[]
 dd=[]
 s=1
 for i in range(n-1):
  s=l[i]
  d.append(s)
  dd.append([i,i])
  for j in range(i+1,n):
   s=s*l[j]
   d.append(s)
   dd.append([i,j])
 d.append(l[n-1])
 dd.append([n-1,n-1])
 k=len(d)
 m=max(d)
 x,y=0,0
 for i in range(k):
  if(d[i]==m):
   x=dd[i]
 print(m,*x)


t=int(input())
for i in range(t):
 n=int(input())
 l=[int(x) for x in input().split()]
 s=0
 e=0
 maxi=l[0]
 for i in range(n):
  prod=l[i]
  if prod>maxi:
   maxi=prod
   s=i
   e=i
  if prod==maxi:
   if i>s:
    s=i
    e=i
   if i==s:
    if i>e:
     e=i
  for j in range(i+1,n):
   prod=prod*l[j]
   if prod>maxi:
    maxi=prod
    s=i
    e=j
   if prod==maxi:
    if i>s:
     s=i
     e=j
    if i==s:
     if j>e:
      e=j 
 print(maxi,s,e)

   


t=int(input())
while(t):
 t=t-1
 n=int(input())
 S=list(map(int,input().split()))
 max1=-1*float("inf")
 for i in range(len(S)):
  p = 1
  for j in range(i,len(S)):
   p = p * S[j] 
   if max1 <= p:
    s_i = i
    s_f = j
    max1 = p
 print(max1,s_i,s_f)

import numpy as np
for _ in range(int(input())):
 a = int(input())
 x = [int(i) for i in input().split()]
 mn = -1000
 for i in range(len(x)):
  for j in range(i,len(x)):
   p = x[i:j+1]
   q = np.prod(p)
   if(q>=mn):
    mn = q
    s = i
    l = j
 print(mn,' ',s,' ',l)


import numpy
for _ in range(int(input())):
 n=int(input())
 l=list(map(int,input().split()))
 ans=float('-inf')
 iidx=0
 fidx=0
 for i in range(len(l) + 1):
  for j in range(i + 1, len(l) + 1):
   sub = l[i:j]

   if len(sub)==0:
    continue
   p=numpy.prod(sub)
   if p>=ans:
    ans=p
    if i>=iidx:
     iidx=i
     if j>=fidx:
      fidx=j
 print(ans,iidx,fidx-1)