#include using namespace std; typedef signed long long ll; #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) template bool chmax(T &a, const T &b) { if(a bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;} //------------------------------------------------------- int N,K,A[18]; vector V[18]; void solve() { int i,j,k,l,r,x,y; string s; cin>>N>>K; FOR(i,N) { cin>>A[i]; x=A[i]; for(j=2;j<=1000;j++) while(x%j==0) x/=j, V[i].push_back(j); } set S; set> C; int mask; FOR(mask,1<=K) { int sum=0; ll mul=1; vector P; FOR(i,N) if(mask&(1<100000) mul=100000; FORR(v,V[i]) P.push_back(v); } S.insert(sum); if(mul<100000){ S.insert(mul); } else { sort(ALL(P)); C.insert(P); } } cout<