#include <iostream>

using namespace std;

const int size = 2000;

void recur(int n, int k)
{
	if(k == 0) return;
	for(int i = 1; i <= n; ++i)
		for(int j = 0; j < n-i+1; ++j)
			recur(n-i, k-1);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int n, k;
	cin >> n >> k;
	
	int arr[size];
	
	for(int i = 0; i < n; ++i)
		cin >> arr[i];
		
	recur (n, k);
}