Write a program that reads numbers until -1 is not given.
The program finds how many of the given numbers are more than 30, $N$.
It also finds the average weighted sum of even numbers, $A$.
The weight of the $i$th number is defined as the position of the number (1 based indexing) times the number. To find the average weighted sum, you need to add all these weights for the even numbers, then divide the sum by the sum of the positions of the numbers.

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- Each testcase contains some numbers, terminated by -1

-----Output:-----
For each testcase, output in a single line the count of numbers that are greater than 30, $N$, and the average weighted sum of the even numbers, $A$, separated by a space. Make sure to set the precision of the average weighted sum to 2 places after the decimal point.

-----Constraints-----
- $1 \leq T \leq 1000$
- $2 \leq N \leq 1000$

-----Sample Input:-----
1
33 100 77 42 12 -1

-----Sample Output:-----
4 38.91

-----EXPLANATION:-----
In the series of numbers 33 100 77 42 12 -1, the count of numbers greater than 30 is 4
The average weighted sum of the even numbers is given by:
((2 * 100) + (4 * 42) + (5 * 12)) / (2 + 4 + 5)

Difficulty: interview

Starter code:

Solutions:
for _ in range(int(input())):
    a=list(map(int,input().split()))
    num=0
    den=0
    k=1
    great=0
    for i in a:
        if i==-1:break
        else:
            if i>30:great+=1
            if i%2==0:
                num+=k*i
                den+=k
            k+=1
    print(great,'%.2f'%(num/den))

for i in range(int(input())):
    c = 0
    arr = list(map(int,input().split()))
    for k in arr:
        if k==-1:
            break
            arr.append(a)
        if k >30:
            c=c+1
    num = 0
    den = 0
    for i in range(0,len(arr)):
        if arr[i]%2==0:
            num = num + arr[i]*(i+1)
            den = den + i + 1
    print(c, "{:.2f}".format(num/den))
        
    
    


T = int(input())
while T:
    numbers = input().split()
    N = 0
    A = 0
    pos = 0
    for i in range(len(numbers)):
        if int(numbers[i]) > 30:
            N += 1
        if int(numbers[i]) % 2 == 0:
            A += (int(numbers[i]) * (i + 1))
            pos += (i + 1)
    print(N, '%.2f'%(A/pos))
    T -= 1

T = int(input())

for testcase in range(T):
    i = 1
    above_30 = 0
    wsum_numerator = 0
    wsum_denominator = 0
    
    vals = [int(f) for f in input().split(" ")]
    
    val = vals[i-1]
    
    while not val == -1:
        if val > 30:
            above_30 += 1
        
        if val % 2 == 0:
            wsum_numerator += i * val
            wsum_denominator += i
        
        i += 1
        val = vals[i-1]
        
    wsum = wsum_numerator / wsum_denominator
    print(above_30, "{:.2f}".format(wsum))


# cook your dish here
for t in range(int(input())):
    N=list(map(int,input().split()))
    c=0
    p=0
    l=[]
    l1=[]
    for i in N:
        p+=1
        if i>30:
            c+=1
        if i>0:
            if i%2==0:
                l.append(i*p)
                l1.append(p)
    out=sum(l)/sum(l1)
    print('{} {:.2f}'.format(c,out))


# cook your dish here
for u in range(int(input())):
    l=list(map(int,input().split()))
    n=len(l)
    s=0
    for i in range(n):
        if(l[i]>30):
            s=s+1
    c=0
    x=0
    for i in range(n):
        if(l[i]%2==0):
            c=c+(l[i]*(i+1))
            x=x+(i+1)
    print(s,end=" ")
    ss=c/x
    print('%.2f'%ss)


t = int(input())
while(t):
    t-=1
    arr = [int(x) for x in input().split()]
    count = 0
    avg = []
    divv = []
    for i in range(len(arr)):
        if(arr[i]==-1):
            break
        else:
            if(arr[i]>=30):
                count+=1
        if(arr[i]& 1==0):
            avg.append((i+1)*arr[i])
            divv.append(i+1)
    average = sum(avg)/sum(divv)
    print(count,'%.2f'%average)
            
            


# cook your dish here
t=int(input())
while(t): 
    l=list(map(int,input().split()))
    count=0
    div=0
    evenSum=0
    for i in range(0,len(l)-1):
        if(l[i]>30):
            count+=1 
        if(l[i]%2==0):
            evenSum+=l[i]*(i+1)
            div+=i+1
    average=evenSum/div 
    print('%d %.2f'%(count,average))
    t-=1

for _ in range(int(input())):
    count=0
    l=list(map(int,input().split(" ")))
    s=0
    d=0
    i=1
    for x in l:
        if x>30:
            count+=1
        if x%2==0:
            s+=(i*x)
            d+=i
        i+=1
    print(count,end=" ")
    print("%.2f"%(s/d))

for _ in range(int(input())):
    count=0
    l=list(map(int,input().split(" ")))
    s=0
    d=0
    i=1
    for x in l:
        if x>30:
            count+=1
        if x%2==0:
            s+=(i*x)
            d+=i
        i+=1
    print(count,end=" ")
    print("%.2f"%(s/d))

t=int(input())
for _ in range(t):
    l=list(map(int,input().strip().split()))
    l.insert(0,0)
    c,n,a=0,0,0
    for i in range(1,len(l)):
        if l[i]>=30:
            c+=1
        if l[i]%2==0:
            a+=l[i]*i
            n+=i
    x=a/n        
    print(c,"{:.2f}".format(x))        



t=int(input())
i=1 
while(i<=t):
    lst=list(map(int,input().strip().split()))
    a=lst.index(-1)
    lst1=lst[0:(a)]
    a1=len([j for j in lst1 if j>30])
    lst2=[k for k in lst1 if (k%2==0)]
    lst3=[0]*len(lst2)
    s=0 
    for l in range(0,len(lst2)):
        lst3[l]=(lst1.index(lst2[l])+1)
        s=s+(lst2[l]*lst3[l])
    ans=s/sum(lst3)
    print(a1,"{0:.2f}".format(ans))
    i+=1 
    


for _ in range(int(input())):
    x = [int(w) for w in input().split()]
    ind = x.index(-1)
    x = x[:ind]
    ctr = 0
    a,b = 0,0
    for i in range(len(x)):
        if x[i] > 30:
            ctr += 1
        if x[i]%2==0:
            a += (i+1)*x[i]
            b += (i+1)
    ans = a/b
    print(ctr,'%.2f'%ans)

for _  in range(int(input())):
	a=list(map(int,input().split()))
	a.remove(-1)
	b=[]
	d=[]
	c=0
	s=0
	for i in range(len(a)):
		if a[i]>30:
			c+=1
		if a[i]%2==0:
			b.append(a[i])
			d.append(i+1)
	for j in range(len(b)):
		s+=b[j]*d[j]
	r=s/sum(d)
	print('{} {:.2f}'.format(c,r))