Automation Machine
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Waylon is working very hard with a task given by his coach, that is, to solve problems! Waylon is very panic, because there is no sufficient time left, however, he has a lot of problems unsolved. To complete the task in time, he invents "Automation Machine" to help him. Since Waylon really cares about the task, he always wants to know how many problems Automation Machine has ACed at that time.

Automation Machine has a special feature. Every time after Waylon finished typing, once the number of lines of code is exactly greater than n , the Automation Machine will automatically submit and AC a question, then clear all the code and start the next question. 

From now on, Waylon will perform a total of T operations which are of two types:
  1. Type k lines of code in a moment.
  2. Ask the number of current AC questions.
Please help the Automation Machine to answer Waylon's question!

输入描述:

In the first line, there are two integers n (1\leq n \leq 10^{12})T (1\leq T \leq 10^6 whose meanings have been stated above.

Then T lines following representing Waylon's operations, the types of operations are as follows:

In each line, the first integer is opt (opt \in \left \{ 1,2 \right \}), representing the type of operation.

if opt=1, then another integer k (1\leq k \leq 10^{12}follows which is the lines of code Waylon typed at that time.

if opt=2, then output the number of current AC questions, Separated by ending of the line.

输出描述:

 Every time when opt=2 , output the number of current AC questions and then switch to the next line.
示例1

输入

复制
10 6
1 5
1 6
2
1 12
2
1 3

输出

复制
1
2

说明

For the first operation, the machine writes 5 lines of code.

For the second operation, the machine writes 6 lines of code, at that moment the number of lines of code is 11, the machine submits the code, and deletes all the code. Now AC 1 question.

The third operation is asking, and at that time there are a total of 1 AC question.

For the fourth operation, the machine writes 12 lines of code, 10 lines AC a question, and the remaining 2 lines were deleted.

The fifth operation is asking, and at that time there are a total of 2 AC questions.
示例2

输入

复制
10 10
1 114514
2
1 1919810
1 9
1 4
1 6
2
1 3
1 8
2

输出

复制
1
3
4