#define _USE_MATH_DEFINES #include #include #include #include #include #include //#include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)< ///////// typedef long long LL; typedef long double LD; ///////// using namespace::std; ///////// const int Amax = 10001; int A[Amax]; bool pdp[Amax]; vector> dp(Amax); vector ans(Amax); void makePrime(int N){ int i,j; for( i=2; i<= N; ++i){ if(pdp[i] == false){ for( j = i+i; j<= N; j += i){ pdp[j] = true; dp[j].push_back(i); } }else{ for( j = i+i; j<= N; j += i){ dp[j].push_back(i); } } dp[i].push_back(i); } return ; } int main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;// //cout << setprecision(16);// int N; cin>>N; int Ymax=0; int ansCount = 1; cin>>ans[0]; int cintemp; for(int i=0;i>cintemp; Ymax = max(Ymax,cintemp+1); ++A[cintemp]; } makePrime(Ymax-1); int count = 1; int minNum = 1;//残った列での最小値 while( A[1] ){//1を全部使う ans[ansCount] = 1; ++ansCount; --A[1]; } for(count = minNum; count::iterator yItr; vector::iterator yBegin; vector::iterator yEnd; while( ansCount < N ){ for(count = minNum; count