shadow2732's blog

By shadow2732, history, 2 years ago, In English
Interesting Pairs

                                      time limit : 2 sec
                                      Memory limit : 256 MegaBytes

A pair ( x , y ) is called an interesting pair if it holds the following condition :- 1. x < y 2. x is even , y is odd

Given an array of n integers , you have to count the total no of interesting pairs.

Input format : the first line of input contains T (T<1000) the no of test cases , next two lines of each test case will contain description of each test case ,length of array n and the elements of array .

It is guarranted that sum of n over all test cases doesn't exceed 2 * 10^5.

Output Format : the only line of output for each test case contains the total of interesting pairs.

Input : 2 10 1 2 3 4 5 6 7 8 9 10 4 2 4 10 12

Output : 10 0

Input : 1 6 4 11 5 6 9 3

Output : 8

  • Vote: I like it
  • 0
  • Vote: I do not like it