Problem2323--Beat The Odds(CF1691A)

2323: Beat The Odds(CF1691A)

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Given a sequence a1,a2,…,ana1,a2,…,an, find the minimum number of elements to remove from the sequence such that after the removal, the sum of every 22 consecutive elements is even.

Input

Each test contains multiple test cases. The first line contains a single integer tt (1≤t≤1001≤t≤100) — the number of test cases. Description of the test cases follows.

The first line of each test case contains a single integer nn (3≤n≤1053≤n≤105).

The second line of each test case contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤1091≤ai≤109) — elements of the sequence.

It is guaranteed that the sum of nn over all test cases does not exceed 105105.

Output

For each test case, print a single integer — the minimum number of elements to remove from the sequence such that the sum of every 22 consecutive elements is even.

Sample Input Copy

2
5
2 4 3 6 8
6
3 5 9 7 1 3

Sample Output Copy

1
0

Source/Category