Math, asked by KAMALTYAGI7430, 1 year ago

You are given with an array a of size n along with q set of operations. An operation is denoted by 3 integers

Answers

Answered by Anonymous
1

First line contains two space-separated integers N and Q, denoting the number of elements in array and number of queries respectively.

Next line contains N space-separated integers denoting elements of the array.

Next Q lines contain a single integer K.

Output:

For each task, print answer in a new line.

Constraints:

2 <= N <= 105

1 <= Q <= 105

0 <= A[i] <= 109

0 <= K < N

Explanation

After 1st operation, the array will become, A = [3,2,4,4]. So, sum of elements = 13.

After 2nd operation, the array will become, A = [3,2,4]. So, sum of elements = 9.


Anonymous: say something yaar
Anonymous: mah.im.a.... please reply?
mahima23112003: Good night kk
mahima23112003: ..
mahima23112003: b bii
mahima23112003: neend
mahima23112003: aa rahi.. h
Anonymous: are you angry?
mahima23112003: no
mahima23112003: ...
Similar questions