Cut Tiles (Small)

Find the fewest M by M tiles that yield all required power-of-two squares when cut without joining pieces.

Medium5GreedyMathNo attempts yetTime limit5sMemory limit512 MB

Problem

Enzo is renovating the house he just bought. The hardest part is buying exactly the right number of tiles.

Enzo needs NN square tiles, and the side length of the kk-th tile is 2Sk2^{S_k}. The store sells only square tiles of size M×MM \times M. Enzo cuts the tiles he buys along lines parallel to their sides, and every tile he needs is cut out of them. Each required tile must be cut whole out of a single purchased tile, and separate pieces cannot be joined together.

What is the smallest number of tiles Enzo has to buy?

Input

The first line contains the number of test cases TT. Each of the next TT lines holds one test case. A line starts with the number of required tiles NN and the size MM of the tiles the store sells, followed by the NN integers S1,S2,,SNS_1, S_2, \dots, S_N that fix the sizes of the required tiles.

Limits

  • 1T1001 \le T \le 100
  • 1N201 \le N \le 20
  • 12SkM23111 \le 2^{S_k} \le M \le 2^{31}-1

Output

For each test case, print one line in the form "Case #x: y", where xx is the test case number starting from 1 and yy is the smallest number of tiles Enzo has to buy.