Hey Everyone, I am trying to solve a problem and got stuck at this subproblem.

### Problem

You are given an initial array **a** with **N** elements.

There are a series of update operations, Let's say there are **K** operation, such that in each operation a_{i} is replaced with x_{i}.

Now there are Q range sum queries, and in each query, you're given **L**, **R**, and **P**.

You have to find the sum of range in **[L, R]** after the **p ^{th}** update has occurred.

### Constraints

- N<=2*10
^{5} - a
_{i}<= 10^{9} - K <= 10
^{5} - Q <= 10
^{5} - L,R <= N

The solution should preferably be with preprocessing and not be with offline queries.

**Example**