fork download
  1. t = int(input())
  2. for _ in range(t):
  3. cnt=0
  4. n = int(input())
  5. ls = list(map(int,input().split(' ')))
  6. for i in range(0,n):
  7. pro=1
  8. for j in range(i,n):
  9. pro = pro*ls[j]
  10. if(pro%4 !=2):
  11. cnt+=1
  12. print(cnt)
Success #stdin #stdout 0.02s 9488KB
stdin
1
18
34 9 15 5 6 1 1 11 8 5 5 -10 5 15 6 -6 -6 5
stdout
136