CF1829B.Blank Space

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

Blank Space

You are given a binary array aa of nn elements, a binary array is an array consisting only of 00s and 11s.

A blank space is a segment of consecutive elements consisting of only 00s.

Your task is to find the length of the longest blank space.

Input

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

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

The second line of each test case contains nn space-separated integers aia_i (0ai10 \leq a_i \leq 1) — the elements of the array.

Output

For each test case, output a single integer — the length of the longest blank space.

Samples

5
5
1 0 0 1 0
4
0 1 1 1
1
0
3
1 1 1
9
1 0 0 0 1 0 0 0 1
2
1
1
0
3

在线编程 IDE

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