Lamb’s Respite

아직 제출이 없습니다시간 제한3초메모리 제한1024 MB

문제

Wookje is playing the game League of Legends, where two teams of players fight against each other. Each player manages a champion whose status can be represented by two integers: the health hh, and the maximum health HH. If a champion's health is less than or equal to zero (h0h \le 0), the champion dies and leaves the game immediately with h=0h = 0. If a champion's health is above the maximum health (h>Hh > H), then it is adjusted to its maximum health. HH will always be a positive integer.

In a teamfight, the health of the champion may increase or decrease. More specifically, during a teamfight, the champion was subject to nn actions. The ii-th (1in1 \le i \le n) action increases the health of the champion by a_ia\_i, subject to the rules above. If a_ia\_i is positive, it means the champion was healed. If a_ia\_i is negative, it means the champion was attacked. If a_ia\_i is zero, then nothing happened to the champion. 

Wookje's favorite champion in League of Legends is a lamb named Kindred. Kindred has a ultimate ability named Lamb's Respite. Let's see what this ability does.

Formally, consider a champion with maximum health HH. If Wookje activates Lamb's Respite from right before the ll-th action until right after the rr-th action, a champion's health will never fall below H10\lceil \frac{H}{10} \rceil during these actions. If a champion's health was less than or equal to H10\lceil \frac{H}{10} \rceil right before the ll-th action, or would hypothetically be less than or equal to H10\lceil \frac{H}{10} \rceil after the ii-th action for some lirl \le i \le r, then its health is set to H10\lceil \frac{H}{10} \rceil and does not change any further until after the rr-th action completes. Otherwise, Lamb's Respite does not affect how the champion's health changes.

It is very important to make the right decision on when to activate Lamb's Respite. Wookje wants to improve his decision-making skills. However, the teamfights are too complicated, therefore it's hard for him to know when to activate Lamb's Respite. To help him, please process the following qq queries:

  • 1 l r x: The champion's maximum health is xx, and its health starts at xx. Lamb's Respite is active from right before the ll-th action to right after the rr-th action. Output the health of the champion after the nn actions. If the champion dies, output 00. (1lrn,1x109)(1 \le l \le r \le n, 1 \le x \le 10^9).
  • 2 i x: Update a_ia\_i to xx. (1in,109x109)(1 \le i \le n, -10^9 \le x \le 10^9).

입력

The first line contains two integers, nn and q (1n,q300,000)q\ (1 \le n, q \le 300\\,000).

The second line contains nn integers. The ii-th integer is a_i (a_i109)a\_i\ (|a\_i| \le 10^9).

The next qq lines contain several integers denoting the queries in the described form.

There is at least 11 query of type 11.

출력

For each query of type 11, output a single integer denoting the answer to that query. Each answer should go on its own line.