#P9865. [POI 2021/2022 R2] lic

[POI 2021/2022 R2] lic

Background

Translated from POI2021~2022R2 Day1T2

Problem Description

Define the “unfriendly numbers” bb of aa as the numbers satisfying gcd(a,b)=1\gcd(a,b)=1

Now you are given the number nn。You need to output the cc numbers starting from the kk-th number in the increasing order of its “unfriendly numbers”。

Input Format

One line with three numbers $n,k,c\ (2 \leq n \leq 10^{14}, 1 \leq k \leq 10^{14}, 1 \leq c \leq 10^5)$。

Output Format

Output cc numbers, representing the kk+c1k \sim k+c-1-th “unfriendly numbers” of nn

10 3 4
7 9 11 13

Hint

Explanation of the sample:

The “unfriendly numbers” of 1010 are 1,3,7,9,11,13,171,3,7,9,11,13,17\ldots in order。

The subtasks are as follows:

Subtask ID Special Property Score
11 n106n \leq 10^6 and MnM \leq n 1010
22 f(n)106f(n) \leq 10^6 and MnM \leq n 3636
33 c100c \leq 100 3030
44 No special limits 2424

Here, MM is the maximum value in the output, and f(n)f(n) is the count of “unfriendly numbers” n\leq n

Translated by ChatGPT 5