#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef double D; typedef pair P; #define M 1000000007 #define F first #define S second #define PB push_back #define INF 100000000000000000 ll n,t[100005],m,seg[1<<18],la[1<<18]; void lazy(int l,int r,int k){ seg[k]+=la[k]; if(l!=r){ la[k*2+1]+=la[k]; la[k*2+2]+=la[k]; } la[k]=0; } void up(int a,int b,int l,int r,int k,ll x){ lazy(l,r,k); if(r>n; n--; for(ll i=0;i>t[i]; up(i,i,0,(1<<17)-1,0,t[i]+(n-i)*3); } cin>>m; for(int i=0;i>l>>r>>d; up(l-1,r-1,0,(1<<17)-1,0,d); cout<