#abc284b. B - Multi Test Cases

B - Multi Test Cases

Score : 200200 points

问题描述

在本问题中,输入文件包含多个测试用例。
首先给出一个整数 TT,请针对 TT 个测试用例解决以下问题。

  • 给定 NN 个正整数 A1,A2,...,ANA_1, A_2, ..., A_N,其中有多少个是奇数?

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

In this problem, an input file contains multiple test cases.
You are first given an integer TT. Solve the following problem for TT test cases.

  • We have NN positive integers A1,A2,...,ANA_1, A_2, ..., A_N. How many of them are odd?

Constraints

  • 1T1001 \leq T \leq 100
  • 1N1001 \leq N \leq 100
  • 1Ai1091 \leq A_i \leq 10^9
  • All values in the input are integers.

Input

The input is given from Standard Input in the following format, where testi\text{test}_i represents the ii-th test case:

TT

test1\text{test}_1

test2\text{test}_2

\vdots

testT\text{test}_T

Each test case is in the following format:

NN

A1A_1 A2A_2 \dots ANA_N

Output

Print TT lines. The ii-th line should contain the answer for the ii-th test case.

Sample Input 1

4
3
1 2 3
2
20 23
10
6 10 4 1 5 9 8 6 5 1
1
1000000000

Sample Output 1

2
1
5
0

This input contains four test cases.

The second and third lines correspond to the first test case, where N=3,A1=1,A2=2,A3=3N = 3, A_1 = 1, A_2 = 2, A_3 = 3.
We have two odd numbers in A1A_1, A2A_2, and A3A_3, so the first line should contain 22.

update @ 2024/3/10 11:53:33