#C3010. Alien Sound Waves

    ID: 46391 Type: Default 1000ms 256MiB

Alien Sound Waves

Alien Sound Waves

You are given an integer N and an integer K for each test case. Your task is to generate all valid "sound waves" which are defined as all the combinations of K numbers chosen from the set \(\{1, 2, \dots, N\}\) in increasing order. In other words, you need to generate the list of all K-combinations of the set \(\{1, 2, \dots, N\}\) in lexicographical order.

If \(K > N\), then there is no way to choose \(K\) numbers from \(N\) numbers; in that case, output NO SOUND WAVES.

The number of possible combinations is given by the binomial coefficient \(\binom{N}{K}\).

Input/Output: The input begins with an integer T (the number of test cases). For each test case, two integers N and K are provided. For each test case, output each valid sound wave in a new line. If there are multiple test cases, their outputs follow consecutively (ignoring blank lines).

inputFormat

The first line contains an integer T, the number of test cases. Each of the following T lines contains two space-separated integers N and K.

For example:

2
4 2
3 3

outputFormat

For each test case, output each valid combination (sound wave) on a separate line. If no valid combination exists (i.e. when K > N), output NO SOUND WAVES. The outputs for consecutive test cases are printed in order without extra blank lines.

## sample
2
4 2
3 3
1 2

1 3 1 4 2 3 2 4 3 4 1 2 3

</p>