题库练习 GamingForces
← 上一题 下一题 →

A15701 | GamingForces

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Monocarp is playing a computer game. He's going to kill $n$ monsters, the $i$ -th of them has $h_i$ health.

Monocarp's character has two spells, either of which he can cast an arbitrary number of times (possibly, zero) and in an arbitrary order:

- choose exactly two alive monsters and decrease their health by $1$ ;
- choose a single monster and kill it.

When a monster's health becomes $0$ , it dies.

What's the minimum number of spell casts Monocarp should perform in order to kill all monsters?

输入格式

The first line contains a single integer $t$ ( $1 \le t \le 10^4$ ) — the number of testcases.

The first line of each testcase contains a single integer $n$ ( $1 \le n \le 100$ ) — the number of monsters.

The second line contains $n$ integers $h_1, h_2, \dots, h_n$ ( $1 \le h_i \le 100$ ) — the health of each monster.

The sum of $n$ over all testcases doesn't exceed $2 \cdot 10^4$ .

输出格式

For each testcase, print a single integer — the minimum number of spell casts Monocarp should perform in order to kill all monsters.

输入输出样例

输入 #1
3
4
1 2 1 2
3
2 4 2
5
1 2 3 4 5
输出 #1
3
3
5
C++ 编辑器
输入
输出