Curious Array

2020 VietMX 0

You’ve got an array consisting of n integers: a[1], a[2], …, a[n]. Moreover, there are m queries, each query can be described by three integers l i, r i, k i. Query l i, r i, k i means that we should add  to each element a[j], where l i ≤ j ≤ r i. […]