Xavier is Learning to Count#3087

Xavier is Learning to Count

10 secondi
64 megabyte
Media

Xavier, a -year-old student, loves solving various puzzles. One of his favourites is the following:

His classmate Xenia has prepared many cards, each with a unique positive integer written on it. She then writes an equation, where the right side is a single positive integer of her choice and the left side is the sum of integers:

She asks Xavier to select cards and place them in the respective X_i positions to make the equation hold, with an additional condition that the X_i must be in increasing order.

Xavier always quickly finds many solutions. Now he wants to know, for any given by Xenia, how many total solutions there are.

Input

There are several test cases, with the number of cases given at the start of the input. Each test case is provided in turn.

For each test case:

The first line contains two space-separated integers and (1 \leq p \leq 5). The second line contains distinct positive integers—the numbers on the cards. None of these numbers exceeds .

There are about test cases in total, but of them are relatively small. More precisely, all numbers are less than or equal to in of the test cases.

Output

For each test case:

For every positive integer, output the number of ways in a single line. To keep the output finite, only output numbers that have a positive count of ways.

Output a blank line after each test case. See the sample for more details on the format.

Esempi

Esempio 1

Loading
Loading