Preparando MOJI

Painting Numbers

2000ms 262144K

Description:

You are given $$$n$$$ integers, each integer is from $$$1$$$ to $$$n$$$, all of them are pairwise distinct. You have to paint them red and blue (each integer should have exactly one color).

The cost of painting is the number of pairs $$$(x, y)$$$ such that $$$y \bmod x = 0$$$, $$$y$$$ is red and $$$x$$$ is blue.

For each $$$k \in [1, n]$$$, calculate the maximum cost of painting if exactly $$$k$$$ integers should have a red color.

Input:

The first line contains one integer $$$n$$$ ($$$2 \le n \le 10^5$$$).

Output:

For each $$$k \in [1,n]$$$ print one integer — the maximum cost of painting, if exactly $$$k$$$ integers should be red.

Sample Input:

6

Sample Output:

3 5 6 6 5 0

Sample Input:

2

Sample Output:

1 0

Sample Input:

11

Sample Output:

3 6 9 11 12 13 14 14 13 10 0

Informação

Codeforces

Provedor Codeforces

Código CF1488G

Tags

*specialdata structuresgreedynumber theory

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 10:11:09

Relacionados

Nada ainda