#include using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; #define rep(i,n) for(ll i=0;i T div_floor(T a, T b) { return a / b - ((a ^ b) < 0 && a % b); } template T div_ceil(T a, T b) { return a / b + ((a ^ b) > 0 && a % b); } template inline bool chmin(T &x, U y) { return (y < x) ? (x = y, true) : false; } template inline bool chmax(T &x, U y) { return (x < y) ? (x = y, true) : false; } template ostream &operator<<(ostream &os, const vector &a){ if (a.empty()) return os; os << a.front(); for (auto e : a | views::drop(1)){ os << ' ' << e; } return os; } void dump(auto ...vs){ ((cout << vs << ' '), ...) << endl; } #include using namespace atcoder; using mint = modint998244353; ll isqrt(ll n){ assert(n>=0); ll s=sqrtl(n); while ((s+1)*(s+1)<=n)s++; while (s*s>n)s--; return s; } const int Width=5; struct S{ ll L; array A; S(){} S(ll _x){ L=1; set(_x); } void set(ll x){ A[0]=x*L; rep(i,Width-1){ x=isqrt(x); A[i+1]=x*L; } return; }; void shift(ll n){ array B; for (ll i=0;i>N>>Q; vector A(N); rep(i,N)cin>>A[i]; vector V(N); rep(i,N){ V[i]=S(A[i]); } lazy_segtree lst(V); rep(_,Q){ ll t; cin>>t; if (t==0){ ll l,r; cin>>l>>r; S res=lst.prod(l,r); ll ans=res.A[0]; if (naive){ ll nans=0; for (ll i=l;i>l>>r>>x; F f; f.type=1; f.x=x; f.s=0; lst.apply(l,r,f); if (naive){ for (ll i=l;i>l>>r; F f; f.type=0; f.x=0; f.s=1; lst.apply(l,r,f); if (naive){ for (ll i=l;isync_with_stdio(0); ll T=1; while (T--){ solve(); } return 0; }