“`
using namespace std;
const int maxn = 1000005;
struct lin{
LL s[maxn<<1];
LL m[maxn<<1];
void init(int l,int r,int k){
if(l == r){
m[k] = 0;
scanf(“%d”,&s[k]);
return ;
}
int m = (l+r) >>1;
init(l,m,k<<1);
init(m+1,r,k<<1|1);
s[k] = s[k<<1]+s[k<<1|1];
}
void push_down(int k,int len){
if(m[k]){
m[k<<1] = m[k<<1|1] = m[k];
s[k<<1] = (len-(len>>1))*m[k];
s[k<<1|1] = (len>>1)*m[k];
m[k] = 0;
}
}
int query(int q,int p,int k,int x,int y){
if(x <= q && p <= y) return s[k];
if(p < x || q > y ) return 0;
push_down(k,p-q+1);
int res=0;
int m = (p+q)>>1;
if(x<=m) res += query(q,m,k<<1,x,y);
if(m