Description

You are given a sequence A of N(N <= 100,000) positive integers. There sum will be less than 10 ^{18}
18
. On this sequence you have to apply M (M <= 100,000) operations:

(A) For given x,y, for each elements between the x-th and the y-th ones (inclusively, counting from 1), modify it to its positive square root (rounded down to the nearest integer).

(B) For given x,y, query the sum of all the elements between the x-th and the y-th ones (inclusively, counting from 1) in the sequence.

Code

-------------本文结束感谢您的阅读-------------