DJ Darko

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

문제

A new DJ is in town. DJ Darko needs to set up his speakers. He has NN speakers in a row with the ii-th speaker volume set to A_iA\_i. Changing the volume is rather difficult so the ii-th speaker requires B_iB\_i units of energy to increase or decrease the volume by the value of 11.

Unforutanently, Darko’s evil twin brother Karko likes to mess with him. There are QQ events that will be happening.

1 l r x
2 l r

In an event of type 1, Karko changes the volume of all speakers from the ll-th to the rr-th by xx. In an event of type 2, Darko sets all the speakers from the ll-th to the rr-th to the same volume in a way that uses up the minimal amount of energy. If there are multiple ways of doing that, he chooses the one which minimizes the final volume.

As a bystander, you would like to know the volume that Darko set for each event of type 2.

입력

The first line contains the number of speakers NN and the number of events QQ. In the second line, there are NN numbers A_iA\_i indicating the current volume of the speakers. In the third line, there are NN numbers B_iB\_i, indicating the energy needed to change the volume of the ii-th speaker by one. In the next QQ lines there are QQ events, formatted in the way described above. All numbers in the input are integers.

출력

For each event of type 2, output the volume to which Darko set the speakers.

제한

  • 1N,Q200,0001 ≤ N, Q ≤ 200\\,000
  • 0A_i,B_i1090 ≤ A\_i , B\_i ≤ 10^9
  • 1lrN1 ≤ l ≤ r ≤ N
  • 109x109-10^{9} ≤ x ≤ 10^9