An error has occurred. Please refresh the page or try after sometime.
Update Queries

1

1 votes
Very-Easy
Problem

You are a given an array of N elements.
Now you have to perform Q queries. over the array elements.
Each Query contains three integers L , R and V.
For each query you have to add V to all integers present in subarray A[L...R].
After you perform all the Q queries print the changed array elements.

Input :
first line contains an integer 'N' (number of elements in array).
On next line there will be N integers (array elements).
on next line there is an integer Q (number of Queries)
Next Q lines contains two integers L , R and V.

output :
After you perform all the Q queries , print the array elements.

constraint :
1<=N<=100000
1<=Q<=100000
1<=L<=R<=N
0<=a[i],V<=100000

Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?