CF1957A.Stickogon

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Stickogon

You are given nn sticks of lengths a1,a2,,ana_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 11 polygon.

Note: Sticks cannot be broken.

Input

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

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

The second line of each test case contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n (1ai1001 \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 44 sticks of length 33 to create a square.

In the fourth test case, we can make a pentagon with side length 22, and a square of side length 44.

Samples

4
1
1
2
1 1
6
2 2 3 3 3 3
9
4 2 2 2 2 4 2 4 4
0
0
1
2

在线编程 IDE

建议全屏模式获得最佳体验