pair<int,int> query(intx,intl,intr,intL,intR){ if(l == L && r == R) returntr [x]; intmid = (l + r) >> 1; if(R <= mid) ...