#include <bits/stdc++.h> using namespace std; class segtree{ public: int n; int* data; int* tree; int* lazy; segtree(int* arr, int _n) : n(_n) { data = new int[_n]; tree = new int[_n * 4]; lazy = new int[_n * 4]; fill_n(tree, _n * 4, 0); fill_n(lazy, _n * 4, 0)...