QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 256 MB مجموع النقاط: 100

#2661. Coprime numbers

الإحصائيات

Bajtazar has recently become fascinated by the topic of coprime numbers. Recall that a natural number $x$ is coprime to a natural number $y$ if the greatest common divisor of $x$ and $y$ is equal to $1$.

For example, the numbers coprime to $10$ are: $1, 3, 7, 9, 11, 13, 17 \dots$

Bajtazar has written down all numbers coprime to $n$ in increasing order. He has framed this list and calls it Bajtazar's list.

Before hanging his work on the wall, he would like to verify the correctness of the list. Since the list is infinite, Bajtazar would only like to randomly check its correctness on a fragment of length $c$, starting from the $k$-th position. The elements of the list are numbered with consecutive integers starting from $1$. Can you help him with this task?

Input

The first line of input contains three natural numbers $n$, $k$, and $c$ ($2 \le n \le 10^{14}$, $1 \le k \le 10^{14}$, $1 \le c \le 100\,000$), specifying, respectively: the number chosen by Bajtazar, the starting position of the fragment to be checked, and the length of the fragment of Bajtazar's list to be checked.

Output

Your program should output $c$ natural numbers separated by single spaces – the consecutive elements at positions $k, (k + 1), (k + 2), \dots, (k + c - 1)$ on Bajtazar's list, which – as a reminder – contains numbers coprime to $n$, written in increasing order.

Examples

Input 1

10 3 4

Output 1

7 9 11 13

Note

Bajtazar asks for the elements at positions $3, 4, 5$, and $6$ on his list. Bajtazar's list in this case (for $n = 10$) consists of the numbers $1, 3, 7, 9, 11, 13, 17 \dots$ in order.

Subtasks

The test set is divided into the following subtasks. Each subtask consists of one or more test groups.

The parameter $M$ denotes the last of the numbers to be printed in the output, and the value $f(n)$ denotes the number of integers not greater than $n$ that are not coprime to $n$.

Subtask Additional conditions Points
1 $n \le 1\,000\,000$ and $M \le n$ 10
2 $f(n) \le 1\,000\,000$ and $M \le n$ 36
3 $n, k \le 10^{14}$ and $c \le 100$ 30
4 no additional constraints 24

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.