CF2014A.Robin Helps

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

Robin Helps

There is a little bit of the outlaw in everyone, and a little bit of the hero too.

The heroic outlaw Robin Hood is famous for taking from the rich and giving to the poor.

Robin encounters nn people starting from the 11-st and ending with the nn-th. The ii-th person has aia_i gold. If aika_i \ge k, Robin will take all aia_i gold, and if ai=0a_i=0, Robin will give 11 gold if he has any. Robin starts with 00 gold.

Find out how many people Robin gives gold to.

Input

The first line of the input contains a single integer tt (1t1041\leq t \leq 10^4) — the number of test cases.

The first line of each test case contains two integers nn, kk (1n50,1k1001 \le n \le 50, 1 \le k \le 100) — the number of people and the threshold at which Robin Hood takes the gold.

The second line of each test case contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n (0ai1000 \le a_i \le 100) — the gold of each person.

Output

For each test case, output a single integer, the number of people that will get gold from Robin Hood.

Note

In the first test case, Robin takes 22 gold from the first person and gives a gold to the second person.

In the second test case, Robin takes 33 gold and gives 11 gold to each of the next 22 people.

In the third test case, Robin takes 33 gold and so only gives gold to 33 other people.

Samples

4
2 2
2 0
3 2
3 0 0
6 2
0 3 0 0 0 0
2 5
5 4
1
2
3
0

在线编程 IDE

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