CF1921F Sum of Progression

Description

You are given an array $ a $ of $ n $ numbers. There are also $ q $ queries of the form $ s, d, k $ . For each query $ q $ , find the sum of elements $ a_s + a_{s+d} \cdot 2 + \dots + a_{s + d \cdot (k - 1)} \cdot k $ . In other words, for each query, it is necessary to find the sum of $ k $ elements of the array with indices starting from the $ s $ -th, taking steps of size $ d $ , multiplying it by the serial number of the element in the resulting sequence.

Input Format

N/A

Output Format

N/A