Codeforces Round 940 (Div. 2) and CodeCraft-23
A
Stickogon
Codeforces
800
原题
←B →
翻译中…

You are given $n$ sticks of lengths $a_1, a_2, \ldots, a_n$. Find the maximum number of regular (equal-sided) polygons you can construct simultaneously, such that:

翻译中…
  • Each side of a polygon is formed by exactly one stick.
  • No stick is used in more than $1$ polygon.
翻译中…

Note: Sticks cannot be broken.

翻译中…

Input

翻译中…

The first line contains a single integer $t$ ($1 \leq t \leq 100$) — the number of test cases.

翻译中…

The first line of each test case contains a single integer $n$ ($1 \leq n \leq 100$) — the number of sticks available.

翻译中…

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \leq a_i \leq 100$) — the stick lengths.

翻译中…

Output

翻译中…

For each test case, output a single integer on a new line — the maximum number of regular (equal-sided) polygons you can make simultaneously from the sticks available.

翻译中…

Note

翻译中…

In the first test case, we only have one stick, hence we can't form any polygon.

翻译中…

In the second test case, the two sticks aren't enough to form a polygon either.

翻译中…

In the third test case, we can use the $4$ sticks of length $3$ to create a square.

翻译中…

In the fourth test case, we can make a pentagon with side length $2$, and a square of side length $4$.

翻译中…

样例

Input #1
4
1
1
2
1 1
6
2 2 3 3 3 3
9
4 2 2 2 2 4 2 4 4
Output #1
0
0
1
2
InputCopy OutputCopy
题目信息
题号
1957A
时间限制
1 s
内存限制
256 MB
标签
构造
贪心

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。