Select n cities from the world map, and a[i] represents the asset value owned by the i-th city. Then there will be several operations. Each turn is to choose the city in the interval [l, r] and increase their asset value by c. And finally, it is required to give the asset value of each city after q operations. ------------------------------------------------------ 从世界地图从选出 n 个城市,a[i]表示选出的第 i 个城市的值。 接下来会有 q 个操作。每一次从区间[l, r]中选出城市,并把它们的值提高 c。 最终求得各个城市的值。
Input
The first line contains two integers n,q (1 ≤ n,q ≤ 2⋅10^5) — the number of cities and operations. The second line contains elements of the sequence a: integer numbers a1, a2, ..., an (−10^6 ≤ ai ≤ 10^6). Then q lines follow, each line represents an operation. The i-th line contains three integers l, r and c (1 ≤ l ≤ r ≤ n, −10^5 ≤ c ≤ 10^5) for the i-th operation. ------------------------------------------------------ 第一行两个整数 n, q (1 ≤ n,q ≤ 2⋅10^5),表示城市数和操作数。 第二行 n 个整数,表示城市 a1, a2, ..., an (−10^6 ≤ ai ≤ 10^6)。 接下来的 q 行,每一行代表一个操作,每一行包括3个整数 l, r 和 c (1 ≤ l ≤ r ≤ n, −10^5 ≤ c ≤ 10^5)。
Output
Print n integers a1,a2,…,an one per line, and ai should be equal to the final asset value of the i-th city. ------------------------------------------------------ 输出n个整数,a1, a2, …, an。