#include using namespace std; using ll = long long; const ll linf=(1LL<<60) - 1; const int inf=(1LL<<30) - 1; const int mod=1000000007; const int MOD=998244353; const ll dx[] = {1, 0, -1, 0, 1, 1, -1, -1}; const ll dy[] = {0, 1, 0, -1, 1, -1, 1, -1}; #define overload4(a,b,c,d,name,...) name #define rep1(n) for(long long _=0;_(a);) #define rrep4(i,a,b,c) for(ll i=(a)+((b)-(a)-1)/(c)*(c);i>=(a);i-=c) #define rrep(...) overload4(__VA_ARGS__,rrep4,rrep3,rrep2,rrep1)(__VA_ARGS__) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define vec(type,name,...) vector name(__VA_ARGS__) #define vv(type,name,h,...) vector name(h,vector(__VA_ARGS__)) #define vvv(type,name,h,w,...) vector name(h,vector(w,vector(__VA_ARGS__))) #define vvvv(type, name, h, w, n, ...) vector>>> name(h, vector>>(w, vector>(n, vector(__VA_ARGS__)))) struct Setting{ Setting(){ cin.tie(nullptr)->sync_with_stdio(0); fixed(cout).precision(12); } }Setting; // #define _GLIBCXX_DEBUG //----------------------------------- void solve() { int N, K; cin >> N >> K; vector A(N); rep(i, N) cin >> A[i]; sort(rall(A)); ll ans = 0; rep(bit, 1<<(N-1)) { ll t = K; rep(i, N-1) { if(bit&(1<> T; while(T--) { solve(); } }