The sum
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The array of elements is given. Find the sum of numbers on a segment.
Input
The first line contains two integers and — the number of elements in array and the number of queries. The next lines contain the queries of two forms:
— assign the value of to each element form position to
— find the sum of array elements on positions from to
Initially the array is filled with zeroes.
Output
For each query of the form "" print the sum of numbers on a segment.
Examples
Input #1
Answer #1
Submissions 4K
Acceptance rate 26%