#P5243. 「2019-05-05提高模拟赛」序列(seq)

「2019-05-05提高模拟赛」序列(seq)

Description

给出一个长度为 nn 的序列 aa,每次对序列进行一下的某一个操作。

操作类型(opt\texttt{opt}) 输入格式 输出格式 操作含义
11 1 l r 一行一个数表示答案 求区间 [l,r][l,r] 的权值之和
22 2 l r 对区间 [l,r][l,r] 中的 每一个数 开根后 下取整

Input Format

第一行两个整数 n,qn,q 表示序列长度和操作个数。
接下来一行 nn 个数,表示序列 aa
接下来 qq 行表示操作,其格式见题目描述。

Output Format

见题目描述。

Sample

样例输入

5 2
1 2 3 4 5
2 1 3
1 1 5

样例输出

12

样例解释

修改操作后序列为:1 1 1 4 5

Hint

数据包编号 分值 nn\le qq\le 特殊性质
11 1010 100100 200200
22 2020 10510^5 2×1052\times 10^5 opt=2,l=r\forall \texttt{opt}=2,l=r
33 ai10\forall a_i\le10
44 1010 1000010000 2000020000
55 4040 10510^5 2×1052\times 10^5

对于所有的数据,保证 aia_iunsigned int\texttt{unsigned int} 范围内。