#include <bits/stdc++.h> using namespace std; int n, m; const int N = 2e5 + 10; int w[N]; typedef long long LL; struct node { int l, r; LL lazy, sum; }; node tr[N * 4]; void pushup(int u) { tr[u].sum = tr[u << 1].sum + tr[u << 1 | 1].sum; } void cal(int u, int lazy, int l, int r) {...