ll@n,@q,@a[n],x[n+1],c[n+1]; x[0]=0,c[0]=0; rep(i,n){ x[i+1] = x[i] + a[i]; c[i+1] = c[i] + a[i] * (a[i] + 1) / 2; } rep(q){ ll@s; if(c[n]