Lines on a Phone Screen
시간 제한2초메모리 제한2048 MB
문장 길이를 갱신하면서 구간마다 너비 24의 그리디 줄바꿈 규칙으로 화면에 몇 줄이 되는지 답한다.
문제
Suppose that there is a sequence of sentences in a mobile phone. To describe the length of each sentence, we use an integer sequence , where is the length of the -th sentence. It is guaranteed that .
To show users the sentences, the mobile phone will print them in order. However, because of the width limitation of the screen, the total length of the sentences in one line should not exceed . Moreover, to make sentences reader-friendly, every sentence should be put in exactly one line (in other words, a sentence cannot be split into multiple lines).
The rule to satisfy the requirements is as follows. The first sentence is printed on the first line. For , the mobile phone prints the -th sentence in the last line if the line length does not exceed after that. Otherwise, it starts a new line and prints the -th sentence in it.
For example, if , the sentences will be printed like this:

Now, here is the problem.
There are sentences, and their lengths are ().
And there are operations to do. Each operation belongs to one of the two types below:
- : Change the length of the -th sentence from to .
- : Determine the number of lines on the screen when printing the sentences with lengths on the mobile phone.
Your task is to answer all questions given by the operations of the second type.
입력
The first line contains two integers and () denoting the number of sentences and the number of operations, respectively.
The second line contains integers () denoting the lengths of the sentences.
Then lines follow. Each of them contains three integers and represents one of the two types of operations:
- "
1": Change the length of the -th sentence from to (, ). - "
2": Print the number of lines when printing sentences from -th to -th on the screen ().
출력
For each operation of the second type, print a single line with the answer.