MULTQ3 - Multiples of 3

题意翻译

## 题目描述 $\mathsf E \color{red} \mathsf{ntropyIncreaser}$ 有一个长度为 $n$ 的序列 $a$,她钦定初始所有数都是 $0$,编号从 $0$ 到 $n-1$。 $\mathsf E \color{red} \mathsf{ntropyIncreaser}$ 需要你完成两种操作: $0$ $l$ $r$ 将区间 $[l,r]$ 的所有数 $+1$ $1$ $l$ $r$ 查询区间 $[l,r]$ 中能被 $3$ 整除的数个数 ( $0$ 也算在内 ) 她觉得这题很简单,但是她困了,要去睡♀觉,所以这个问题就由你来解决。 ## 输入输出格式 ### 输入格式 第一行两个正整数 $n,q$,意义如题目描述。 接下来 $q$ 行,每行三个整数,表示一次操作。 ### 输出格式 对于每个 $1$ 操作,输出一行一个整数表示答案。 ## 说明 样例输入: ```cpp 4 7 1 0 3 0 1 2 0 1 3 1 0 0 0 0 3 1 3 3 1 0 3 ``` 样例输出: ```cpp 4 1 0 2 ``` 【数据范围】 $1\le n,q \le 10^5$

题目描述

There are N numbers a\[0\],a\[1\]..a\[N - 1\]. Initally all are 0. You have to perform two types of operations : 1) Increase the numbers between indices A and B (inclusive) by 1. This is represented by the command "0 A B" 2) Answer how many numbers between indices A and B (inclusive) are divisible by 3. This is represented by the command "1 A B".

输入输出格式

输入格式


The first line contains two integers, N and Q. Each of the next Q lines are either of the form "0 A B" or "1 A B" as mentioned above.

输出格式


Output 1 line for each of the queries of the form "1 A B" containing the required answer for the corresponding query.

输入输出样例

暂无测试点