#include<bits/stdc++.h>using ll = long long;#define endl '\n'struct node{ int l,r; ll val;};std::vector<node> t;std::vector<ll> v;int n;void modify(int p,int x,int y){ if(t[p].l==t[p].r){ t[p].val=y; return; } int mid=(t[p].l+t[p].r)/2; if(x<=mid)...