403426: GYM101156 N Cut Tiles

Memory Limit:256 MB Time Limit:4 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

N. Cut Tilestime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Enzo is doing renovation for his new house. The most difficult part is to buy exactly the right number of tiles. He wants n tiles of different sizes. Of course they have to be cut from the tiles he bought. All the required tiles are square. The lengths of side of the tiles are 2s1, 2s2, ..., 2sn. He can only buy a lot of tiles sized m × m, and he decides to only cut tiles parallel to their sides for convenience. How many tiles does he need to buy?

Input

The first line of the input gives the number of test cases: t (1 ≤ t ≤ 1000). t lines follow. Each line start with the number n (1 ≤ n ≤ 500) and m (1 ≤ m ≤ 231 - 1), indicating the number of required tiles and the size of the big tiles Enzo can buy. n numbers follow: s1, s2, ..., sn (1 ≤ 2sk ≤ m), showing the sizes of the required tiles.

Output

For each test case, output one line containing the number of the big tiles Enzo need to buy.

ExampleInput
4
1 6 2
2 6 2 2
3 6 2 1 1
7 277 3 8 2 6 1 3 6
Output
1
2
1
2

加入题单

上一题 下一题 算法标签: