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