#include using namespace std; typedef signed long long ll; #undef _P #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 ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) //------------------------------------------------------- int N,K; string S[101]; set>> memo; void solve() { int i,j,k,l,r,x,y; string s; FOR(i,100) { S[i]=to_string(i); FORR(c,S[i]) c=(9-(c-'0'))+'0'; } cin>>N>>K; vector L(100); int ML=0; FOR(i,N) { cin>>x; L[x]++; ML+=S[x].size(); } priority_queue,int>,vector,int>>,greater,int>>> PQ; PQ.push({"",L,-1}); while(K) { string cur=get<0>(PQ.top()); vector V=get<1>(PQ.top()); int pre=get<2>(PQ.top()); PQ.pop(); if(cur.size()==ML) { FORR(c,cur) c=(9-(c-'0'))+'0'; cout<