#include <iostream>
#include <cstring>
#include <algorithm>
#define N 100
using namespace std;
int a[N],b[N];
int ans=0;
int n,r;
void f(int t,int k){
if(k==r){
ans++;
for (int i = 0; i < r; i ++ ) cout << b[i] <<" ";
puts("");
return;
}
for (int i = t+1; i <= n; i ++ ){
b[k]=a[i];
f(i,k+1);
}
}
int main()
{
cin >> n >> r;
for (int i = 1; i <= n; i ++ ) cin >> a[i];
sort(a+1,a+1+n);
f(0,0);
cout<<ans;
return 0;
}
选数(oj没有 没有AC