Using his tip-top physique, Kim has now climbed up the mountain where the base is located. Kim has found the door to the (supposedly) super secret base. Well, it is super secret, but obviously no match for Kim's talents. 
The door is guarded by a row of $N$ buttons. Every button has a single number $A_i$ written on it. Surprisingly, more than one button can have the same number on it. Kim recognises this as Soum's VerySafe door, for which you need to press two buttons to enter the password. More importantly, the sum of the two numbers on the buttons you press must be odd. Kim can obviously break through this door easily, but he also wants to know how many different pairs of buttons he can pick in order to break through the door.
Can you help Kim find the number of different pairs of buttons he can press to break through the door? 
Note: Two pairs are considered different if any of the buttons pressed in the pair is different (by position of the button pressed). Two pairs are not considered different if they're the same position of buttons, pressed in a different order. 
Please refer to the samples for more details.

-----Input:-----
- The first line contains a single integer $T$, representing the number of testcases. $2T$ lines follow, 2 for each testcase.
- For each testcase, the first line contains a single integer $N$, the number of buttons.
- The second line of each testcase contains $N$ space-separated integers, $A_1, A_2, \ldots, A_N$, representing the numbers written on each button.

-----Output:-----
Print a single number, $K$, representing the number of pairs of buttons in $A$ which have an odd sum.

-----Subtasks-----
For all subtasks,  $1 \leq T \leq 10$, $1 \leq N \leq 100000$, and $1 \leq A_i \leq 100000$ for all $A_i$.
Subtask 1 [15 points] : $N \leq 2$, There are at most 2 buttons
Subtask 2 [45 points] : $N \leq 1000$, There are at most 1000 buttons
Subtask 3 [40 points] : No additional constraints.

-----Sample Input:-----
3
4
3 5 3 4
2
5 7
1
4

-----Sample Output:-----
3
0
0

-----EXPLANATION:-----
This section uses 1-indexing.
In the first sample, the buttons are: $[3, 5, 3, 4]$
$A[1] +  A[4] = 3 + 4 = 7$ which is odd.
$A[2] +  A[4] = 5 + 4 = 9$ which is odd.
$A[3] +  A[4] = 3 + 4 = 7$ which is odd.
In total, there are 3 pairs with an odd sum, so the answer is 3.
In the second sample, the buttons are: $[5, 7]$. There are no odd pairs, so the answer is $0$.
In the third sample, the buttons are: $[4]$. There are no pairs at all, so the answer is $0$.

Difficulty: interview

Starter code:

Solutions:
# cook your dish here
for _ in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 even=[]
 odd=[]
 for i in a:
  if(i & 1):
   even.append(i)
  else:
   odd.append(i)
 print(len(even)*len(odd))

t=int(input()) 
for kkk in range(t): 
 n=int(input()) 
 a=[int(x) for x in input ().split()] 
 e=0
 o=0
 for i in range(n): 
  if a[i]%2==0: 
   e+=1
  else: 
   o+=1
 print(e*o)


# cook your dish 
for _ in range(int(input())):
 x = int(input())
 arr = list(map(int,input().split()))
 count = 0
 if (x ==1):
  print("0")
 else:
  for i in arr:
   if i % 2==0:
    count+=1
  ak = x-count
  print(ak*count)


# cook your dish 
for _ in range(int(input())):
 x = int(input())
 arr = list(map(int,input().split()))
 count = 0
 if (x ==1):
  print("0")
 else:
  for i in range(x-1):
   if ((arr[i] + arr[-1]) % 2==1 ):
    count +=1
  print(count)


# cook your dish 
for _ in range(int(input())):
 x = int(input())
 arr = list(map(int,input().split()))
 count = 0
 if (x ==1):
  print("0")
 else:
  for i in range(x-1):
   if ((arr[i] + arr[-1]) % 2==1 ):
    count +=1
  print(count)


# cook your dish here
from collections import Counter
for _ in range(int(input())):
 
 n=int(input())
 c=Counter([int(x)%2 for x in input().split()])
 
 print(c[0]*c[1])


for _ in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 odd=0
 even=0
 for i in range(n):
  if a[i]%2==1:
   odd+=1
 even=n-odd
 print(even*odd)

for _ in range(int(input())):
 N=int(input())
 count=0
 arr=list(map(int,input().split()))
 if(len(arr)==1):
  print("0")
 else:
  for i in range(len(arr)):
   if(arr[i]%2==0):
    for j in range(i+1,len(arr)):
     if(arr[j]%2!=0):
      count+=1
   else:
    for j in range(i+1,len(arr)):
     if(arr[j]%2==0):
      count+=1
  print(count)

for _ in range(int(input())):
 N=int(input())
 count=0
 arr=list(map(int,input().split()))
 if(len(arr)==1):
  print("0")
 else:
  for i in range(len(arr)):
   if(arr[i]%2==0):
    for j in range(i+1,len(arr)):
     if(arr[j]%2!=0):
      count+=1
   elif(arr[i]%2!=0):
    for j in range(i+1,len(arr)):
     if(arr[j]%2==0):
      count+=1
  print(count)

for _ in range(int(input())):
 N=int(input())
 count=0
 arr=list(map(int,input().split()))
 if(len(arr)==1):
  print("0")
 else:
  for i in range(len(arr)):
   for j in range(i+1,len(arr)):
    if((arr[i]+arr[j])%2!=0):
     count+=1
  print(count)

import sys
import math

def main(arr):
 odd,even=0,0 
 
 ans=0
 
 for e in arr:
  if e&1:
   odd+=1 
  else:
   even+=1 
 
 for e in arr:
  
  if e&1:
   ans+=even
   odd-=1 
  else:
   ans+=odd
   even-=1 
 return ans

for _ in range(int(input())):
 n=int(input())
 arr=list(map(int,input().split()))
 print(main(arr))

# cook your dish here
t = int(input())
for _ in range(t):
 n = int(input())
 but = list(map(int,input().split()))
 odd = [i%2 for i in but]
 no = odd.count(1)
 ne = odd.count(0)
 ans = no*ne
 print(ans)


t=int(input())
for _ in range(t):
 num=int(input())
 l=list(map(int,input().split()))
 even=0
 for i in l:
  if i%2==0:
   even+=1
 odd=num-even
 print(odd*even)

t = int(input())
for _ in range(t):
 input()
 t1 = [int(i) for i in input().strip().split(' ')]
 t1o = 0
 for i in t1:
  if i % 2 == 0:
   t1o += 1
 t1e = len(t1) - t1o
 print(t1e*t1o)

from itertools import combinations 

t = int(input())
for _ in range(t):
 n = int(input())
 lst = list(map(int, input().split()))
 a = list(combinations(lst, 2)) 
 count = 0
 for i in range(len(a)):
  if sum(a[i]) % 2 != 0:
   count += 1
 print(count)


# cook your dish here
t = int(input())
while t>0:
 n = int(input())
 a = list(map(int, input().split()))
 cnt = 0
 for i in range(n):
  if a[i]%2!=0:
   cnt = cnt + 1
 ans = n - cnt
 print(ans*cnt)
 t = t-1


T = int(input())
for _ in range(T):
 n = int(input())
 l = list(map(int, input().split()))
 even, odd = [], []
 for num in l:
  if num%2 == 0:
   even.append(num)
  else:
   odd.append(num)
 print(len(even)*len(odd))

# cook your dish here
try:
 t=int(input())
 for _ in range(t):
  n=int(input())
  l=list(map(int,input().split()))
  sum,c=0,0
  for i in range(len(l)):
   for j in range(i,len(l)-1):
    sum=sum+l[j]+l[j+1]
    if sum%2!=0:
     c=c+1
  print(c)
except:
 pass

t=int(input())
for i in range(t):
 n=int(input())
 a=list(map(int,input().split()))
 o=0
 e=0
 for j in a:
  if(j%2==0):
   e+=1
  else:
   o+=1
 print(o*e) 

# cook your dish here
t=int(input())
for i in range(t):
 n=int(input())
 a=list(map(int,input().split()))
 odd=0
 even=0
 for j in a:
  if(j%2==0):
   even+=1
  else:
   odd+=1
 print(odd*even) 

# cook your dish here
#BUTTON PAIRS

t = int(input())
for i in range(t):
 n = int(input())
 l = list(map(int,input().split()))
 cnte = 0
 cnto = 0
 
 for i in l:
  if i % 2 == 0:
   cnte += 1
  else:
   cnto += 1
   
 res = cnte*cnto
 print(res)


t = int(input())
while t > 0:
 n = int(input())
 lst = list(map(int, input().split()))
 count, count1 = 0, 0
 for i in range(n):
  if lst[i] % 2 == 0:
   count += 1
  else:
   count1 += 1
 print(count * count1)

 t -= 1