#if __INCLUDE_LEVEL__ #include #include //#define int long long #endif #if !__INCLUDE_LEVEL__ #include __FILE__ //using mint=atcoder::static_modint<998244353>; //using mint=modint; atcoder::modint::set_mod(int m); //using vm=vector; using vvm=vector; using vvvm=vector; //cout<>N; vi used(N+1,false); rep(i,N){ int m=i+1; for(int j=2;j*j<=m;j++) if(m%(j*j)==0){m/=j*j;j--;} int res=m; for(int j=1;j*j<=N;j++) if(m*j*j<=N && !used[m*j*j]) res=m*j*j; used[res]=true; cout<; using vl = vector; using vll = vector; using vb = vector; using vvi = vector; using vvl = vector; using vvll = vector; using vvvi = vector; using vs = vector; using pii = pair; using vpii = vector; #define rep(i,n) for(int i=0;(i)<(int)(n);(i)++) #define REPD(i,n) for(int i=(int)(n)-1;(i)>=0;(i)--) #define FOR(i,a,n) for(int i=(a);(i)<(int)(n);(i)++) #define FORD(i,a,n) for(int i=(int)(n)-1;(i)>=(int)(a);(i)--) #define fore(x,vec) for(auto &x:(vec)) template inline T chmax(T &a,const T &b){if(a inline T chmin(T &a,const T &b){if(b ostream &operator<<(ostream &os,const vector &vec){ for(int i=0;i<(int)vec.size();i++){os< istream &operator>>(istream& is,vector& vec){ for(int i=0;i<(int)vec.size();i++){is>>vec[i];}return is; } template inline bool isPrime(T &a){ if(a<2){return 0;}for(T i=2;i*i<=a;i++){if(a%i==0)return 0;}return 1; } //エラトステネスの篩 template vector primes(T& N) { vector isprime(N+1,true);isprime[0]=isprime[1]=false; for(T p=2;p T pow_mod(T A, T N, T M) { T res = 1 % M; A %= M; while (N) { if (N & 1) res = (res * A) % M; A = (A * A) % M; N >>= 1; } return res; } bool MillerRabin(long long N, vector A) { long long s = 0, d = N - 1; while (d % 2 == 0) { ++s; d >>= 1; } for (auto a : A) { if (N <= a) return true; long long t, x = pow_mod<__int128_t>(a, d, N); if (x != 1) { for (t = 0; t < s; ++t) { if (x == N - 1) break; x = __int128_t(x) * x % N; } if (t == s) return false; } } return true; } bool is_prime(long long N) { if (N <= 1) return false; if (N == 2) return true; if (N % 2 == 0) return false; if (N < 4759123141LL) return MillerRabin(N, {2, 7, 61}); else return MillerRabin(N, {2, 325, 9375, 28178, 450775, 9780504, 1795265022}); } // ミラーラビン法 ここまで //素因数分解 vpii prime_factories(int N){ vpii res; for(int a=2;a*a<=N;a++){ if(N%a!=0)continue; int ex=0; while(N%a==0){ ex++; N/=a; } res.pb({a,ex}); } if(N!=1)res.pb({N,1}); return res; } // 二分探索: // !f(v[i-1]) && f(v[i]) となるようなiのうちいずれか1つを返すか、 // 存在しないとき f(v[0]) なら 0, !f(v[0]) なら v.size() を返す // 制約 : f(v[0]) ⇒ f(v[v.size()-1]) template int binarySearch(vector& v, function f){ int min=-1, max=v.size(); for(;max-min>1;){ int mid=(min+max)/2; if(f(v[mid])) max=mid; else min=mid; } return max; } // 二分探索: // !f(i-1) && f(i) となるようなiのうちいずれか1つを返すか、 // 存在しないとき f(0) なら 0, !f(0) なら N を返す // 制約 : f(0) ⇒ f(N) int binarySearch(int N, function f){ int min=-1, max=N; for(;max-min>1;){ int mid=(min+max)/2; if(f(mid)) max=mid; else min=mid; } return max; } // 正確な比較が可能な分数 template class fraction{ public: // 分母, 分子 T top, bottom; fraction(T top_,T bottom_){top=top_;bottom=bottom_;if(bottom==0) ERROR("fraction constractor: 0-devided error");} friend bool operator<(fraction const& a,fraction const& b){ if(a.bottom>0!=b.bottom>0) return (ll)a.top*(ll)b.bottom<(ll)b.top*(ll)a.bottom; else return (ll)a.top*(ll)b.bottom>(ll)b.top*(ll)a.bottom; } friend bool operator>(fraction const& a,fraction const& b){ if(a.bottom>0!=b.bottom>0) return (ll)a.top*(ll)b.bottom>(ll)b.top*(ll)a.bottom; else return (ll)a.top*(ll)b.bottom<(ll)b.top*(ll)a.bottom; } friend bool operator!=(fraction const& a,fraction const& b){return a>b||a=(fraction const& a,fraction const& b){return a>b||a==b;} friend bool operator<=(fraction const& a,fraction const& b){return a