write a go solution for Description:
You have an array a consisting of n distinct positive integers, numbered from 1 to n. Define p_k as p_k = \sum_{1 \le i, j \le k} a_i \bmod a_j, where xbmody denotes the remainder when x is divided by y. You have to find and print p_1,p_2,ldots,p_n.
Input Format:
The first line contains n — the length of the array (2<=n<=2*10^5).
The second line contains n space-separated distinct integers a_1,ldots,a_n (1<=a_i<=3*10^5, a_ineqa_j if ineqj).
Output Format:
Print n integers p_1,p_2,ldots,p_n.
Note:
None. Output only the code with no comments, explanation, or additional text.