#P5495. Divisor Sum Sequence

    ID: 18727 Type: Default 1000ms 256MiB

Divisor Sum Sequence

Divisor Sum Sequence

Given an integer sequence \(a_1, a_2, a_3, \dots, a_n\), your task is to compute a new sequence \(b_1, b_2, b_3, \dots, b_n\) such that

[ b_k = \sum_{i|k} a_i ]

for each \(1 \le k \le n\), where the summation is taken over all indices \(i\) that divide \(k\). Since the numbers might be very large, each \(b_k\) should be computed modulo \(2^{32}\).

inputFormat

The first line contains an integer \(n\) representing the length of the sequence. The second line contains \(n\) space-separated integers \(a_1, a_2, \dots, a_n\).

outputFormat

Print \(n\) integers representing the sequence \(b_1, b_2, \dots, b_n\), each separated by a space.

sample

5
1 2 3 4 5
1 3 4 7 6