Given an Array A, with n elements and also a set of Q queries.
Each query contains L and R and V. Your task is to add V for all indexes from L to R, both inclusive.
Finally, print the array after all Q queries.
Constraints
1 <= N <= 106
1 <= Q <= 106
1 <= L, R, <= N
Input format
First line contains N, followed by N elements of the array
Next line contains Q, the number of queries
This is followed by Q lines, each containing the respective L, R and V
Output format
Print the array in a single line after all queries are completed.
Example Input
10
Answers
Answered by
2
Answer:
array of the single containing the queries
Similar questions