# Naive Operations

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 502768/502768 K (Java/Others)

### Problem Description

In a galaxy far, far away, there are two integer sequence a and b of length n.
b is a static permutation of 1 to n. Initially a is filled with zeroes.
There are two kind of operations:
1. add l r: add one for $a_l,a_{l+1}…a_r$
2. query l r: query $\sum_{i=l}^r \lfloor a_i / b_i \rfloor$

### Input

There are multiple test cases, please read till the end of input file.
For each test case, in the first line, two integers n,q, representing the length of a,b and the number of queries.
In the second line, n integers separated by spaces, representing permutation b.
In the following q lines, each line is either in the form ‘add l r’ or ‘query l r’, representing an operation.
$1 \leq n,q \leq 100000$, $1 \leq l \leq r \leq n$, there’re no more than 5 test cases.

### Output

Output the answer for each ‘query’, each one line.

5 12

1 5 2 4 3

query 1 4

query 2 5

query 1 5

query 1 4

query 2 5

query 1 5

1

1

2

4

4

6

## 思路

QAQ，关于想明白非叶子结点更新要在 O (1) 结点想出也是源于上海大都会赛上一个线段树的反思。等我明白后补上那题。

❤采之欲遗谁，所思在远道。❤