#include #include #include using namespace std; typedef long long ll; typedef pair P; typedef pair P1; typedef pair P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define mod 998244353 #define fi first #define sc second #define rep(i,x) for(int i=0;i= 2e9 || b >= 2e9) return 2e9; return a*b/gcdd(a,b); } ll G[1<<18],L[1<<18],mx[1<<18],sum[1<<18]; ll upd[1<<18]; void push(int k,ll val){ G[k*2+1] = G[k*2+2] = L[k*2+1] = L[k*2+2] = mx[k*2+1] = mx[k*2+2] = upd[k*2+1] = upd[k*2+2] = upd[k]; sum[k*2+1] = sum[k*2+2] = val * upd[k]; upd[k] = 0; } void update(int x,ll v){ x += (1<<17)-1; G[x] = L[x] = sum[x] = mx[x] = v; while(x){ x = (x-1)/2; G[x] = gcdd(G[x*2+1],G[x*2+2]); assert(gcdd(L[2*x+1],L[2*x+2]) > 0); L[x] = makeL(L[x*2+1],L[x*2+2]); sum[x] = sum[x*2+1]+sum[x*2+2]; mx[x] = max(mx[x*2+1],mx[x*2+2]); } } void set_val(int a,int b,int k,int l,int r,ll x){ if(r