#P3708. koishi的数学题

    ID: 2684 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>递推洛谷原创枚举,暴力前缀和洛谷月赛

koishi的数学题

Description

Under Flandre's guidance, Koishi has become a math master, and she came up with a simple math problem.

Given an integer nn, let f(x)=i=1nxmodi\displaystyle f(x) = \sum_{i=1}^n x \bmod i. You need to output f(1),f(2),,f(n)f(1), f(2), \ldots, f(n).

As usual, Koishi pretends she cannot solve this problem and asks you for help.

Input Format

A positive integer nn.

Output Format

One line containing nn integers f(1),f(2),,f(n)f(1), f(2), \ldots, f(n) separated by spaces.

10

9 16 22 25 29 27 29 24 21 13

Hint

For 20%20\% of the testdata, n1000n \le 1000.
For 60%60\% of the testdata, n105n \le 10^5.
For 100%100\% of the testdata, 1n1061 \le n \le 10^6.

Translated by ChatGPT 5