Array and Operations

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

You have an array aa with nn integers. There are three types of operations:

  • "1 ll rr xx": for each ii in \[l,r]\[l, r], change a_ia\_i to a_i+xa\_i + x;
  • "2 ll rr": for each ii in \[l,r]\[l, r], change a_ia\_i to a_i\lfloor \sqrt{a\_i} \rfloor;
  • "3 ll rr": sum up a_ia\_i for all ii in \[l,r]\[l, r] and print the answer.

Your goal is to process the operations and print the answers of all type 3 operations.

입력

The first line of the input contains two integers nn and qq (1n,q1051 \le n, q \le 10^5). The second line contains nn integers a_1,,a_na\_1, \ldots, a\_n. Then qq lines follow, each line describes an operation.

It is guaranteed that 1a_i,x1051 \le a\_i, x \le 10^5, 1lrn1 \le l \le r \le n.

출력

For each operation of type 3, print a single line containing the required sum.