You are given an array $$$A$$$ of size $$$N$$$ and $$$Q$$$ queries.
In each query, you will be given three integers: $$$l$$$, $$$r$$$, and $$$x$$$. Find the value of
$$$$$$
(A_l \text{ mod } x) + (A_{l + 1} \text{ mod } x) + \dots + (A_{r - 1} \text{ mod } x) + (A_r \text{ mod } x)
$$$$$$
Note that $$$(x \text{ mod } y)$$$ denotes the remainder when $$$x$$$ is divided by $$$y$$$.
The first line contains two integers $$$N$$$ and $$$Q$$$ ($$$1\leq N, Q\leq 2\cdot 10^5$$$) — the length of the array and the number of queries.
The second line contains $$$N$$$ integers $$$A_1, A_2, \dots, A_N$$$ ($$$1\leq A_i\leq 2\cdot 10^5$$$) — the elements of the array $$$A$$$.
Each of the next $$$Q$$$ lines contains three integers $$$l$$$, $$$r$$$, and $$$x$$$ ($$$1\leq l\leq r\leq N$$$, $$$1\leq x\leq 2\cdot 10^5$$$) — descriptions of the queries.
Print $$$Q$$$ integers — the answers to the queries.
7 1014 16 9 6 9 10 165 6 32 2 75 7 54 6 47 7 77 7 162 6 156 6 127 7 113 7 2
1 2 5 5 2 0 35 10 5 2
7 108 18 6 15 4 18 155 7 21 1 184 5 33 5 126 7 105 5 144 4 14 4 197 7 126 6 4
1 8 1 13 13 4 0 15 3 2
7 1014 8 8 12 7 10 155 5 101 4 52 4 62 3 175 6 93 7 156 6 117 7 107 7 202 7 17
7 12 4 16 8 37 10 5 15 60
7 1011 9 18 5 11 14 101 7 183 6 47 7 164 4 55 6 124 6 167 7 22 3 53 7 42 4 19
60 8 10 0 13 30 0 7 10 32