SP9066 XXXXXXXX - Sum of Distinct Numbers
Description
You are given N numbers. You have to perform two kinds of operations:
U x y - x-th number becomes equal to y.
Q x y - calculate the sum of distinct numbers from x-th to y-th. It means that the sum for the set {1, 2, 3, 2, 7} will be equal to 13 (1+2+3+7).
Input Format
The first line of input contains an integer N. 1
Output Format
Output an answer for every query of the second type.