← All problemsSign in

I D K XOR

You are given an array A1,A2...AN. You have to tell how many pairs (i, j) exist such that 1 ≤ i and Ai XOR Aj is odd. Input and Output First line T, the number of testcases. Each testcase: first line N, followed by N integers in next line. For each testcase, print the required answer in one line. Constraints 1 ≤ T ≤ 10 1 ≤ N ≤ 105 0 ≤ Ai ≤ 109 Sample Input: 2 3 1 2 3 4 1 2 3 4 Sample

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start