Gary likes to solve algorithmic problems but he doesn't like problems that involve queries. His school teacher gave him an assignment full of problems but one of them involve queries. Can you help Gary in solving that problem so that he can go and play with his friends? The problem is :
Given an Array A consisting of N positive integers, you have to answer Q queries on it. Queries can be of the two types:
Input:
The first line contains two space separated integers N and Q.
Next line contains N space separated integers denoting array A.
Next Q lines contain queries of one of the above mentioned type format.
Output:
Answer to the each query of type 2 in a new line .
Constraints:
1≤N≤5∗105
1≤Q≤5∗105
1≤Ai,X,Y≤5∗105
After query 1 the array becomes : 3 3 2 1 2
Answer for query 2 is : ⌊35⌋+⌊35⌋+⌊25⌋+⌊15⌋+⌊25⌋=0
After query 3 the array becomes : 3 3 2 4 2
Answer for query 4 is : ⌊31⌋+⌊31⌋+⌊21⌋+⌊41⌋+⌊21⌋=14