// NOTE: it is recommended to use this even if you don't understand the following code. #include #include #include #include using namespace std; int main() { // uncomment the two following lines if you want to read/write from files // ifstream cin("input.txt"); // ofstream cout("output.txt"); // fast input/output, needed for N and Q up to 500000 ios_base::sync_with_stdio(false); cin.tie(NULL); int N, Q; cin >> N >> Q; vector arr(N); for (int i = 0; i < N; ++i) cin >> arr[i]; vector l(Q), r(Q), k(Q); for (int i = 0; i < Q; ++i) cin >> l[i] >> r[i] >> k[i]; vector ans(Q); // INSERT YOUR CODE HERE for (int i = 0; i < Q; ++i) cout << ans[i] << "\n"; return 0; }