#include<iostream> #include<stdio.h> #include<algorithm> using namespace std; const int N = 1e5+10; typedef long long ll; struct node{ int l,r,add; ll maxx,s,a,max_id,id; }tr[4*N]; struct node1{ int s,a; }p[N]; int pos,pos_i=1; bool cmp(node1 a,node1 b) { if(a.s!=b....