#abc256h. Ex - I like Query Problem
Ex - I like Query Problem
Score : points
问题描述
给定 、 和序列 。
处理以下描述的 个查询,每个查询属于以下三种类型之一:
1 L R x
: 对于 ,将 的值更新为 $\displaystyle \left\lfloor \frac{a_i}{x} \right\rfloor$。2 L R y
: 对于 ,将 的值更新为 。3 L R
: 输出 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given , , and .
Process queries described below. Each query is of one of the following three kinds:
1 L R x
: for , update the value of to $\displaystyle \left\lfloor \frac{a_i}{x} \right\rfloor$.2 L R y
: for , update the value of to .3 L R
: print .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format, where denotes the -th query to be processed:
Each query is given in one of the following three formats:
Output
Print the answer to the queries as specified in the Problem Statement, with newlines in between.
Sample Input 1
3 5
2 5 6
3 1 3
1 2 3 2
3 1 2
2 1 2 3
3 1 3
Sample Output 1
13
4
9
Initially, . Thus, the answer to the -st query is .
When the -nd query has been processed, . Thus, the answer to the -rd query is .
When the -th query has been processed, . Thus, the answer to the -th query is .
Sample Input 2
6 11
10 3 5 20 6 7
3 1 6
1 2 4 3
3 1 3
2 1 4 10
3 3 6
1 3 6 2
2 1 4 5
3 1 6
2 1 3 100
1 2 5 6
3 1 4
Sample Output 2
51
12
33
26
132
update @ 2024/3/10 10:54:34