Problem list
Log in
#coci00490 · COCI 2017/2018 Contest 7

Timovi

Silver II 1.0 s 64 MB

1 $s / 64$ $MB / 80$ points

We need to arrange ​$M$ kids in ​$N$ teams. We begin by placing ​$K$ ​kids in each team, starting

from the first to the ​$N$​^{th} team. When we finish with the ​$N$​^{th} team, we switch directions and

continue, placing ​$K$ kids in each team, from the (​$N$​-1)​^{th} ​to the first team, respectively. When

we finish with the first team, we switch directions again and continue the process from the

second to the ​$N$​^{th} team, respectively, and so on until there are no kids left to distribute. For

example, if we have three teams, we will place ​$K$ kids in teams in the following order: first

team, second team, third team, second team, first team, second team, etc.

If, at any points, there are less than ​$K$ kids left to place in the current team, we place all the

remaining kids in that team and end the process. Output the number of kids in each team when the process ends.

Input

The first line of input contains the integers ​$N$ ​(2 ≤ ​$N$​ ≤ 200 000), ​$K$​ and ​$M$ (1 ≤ ​$K$ ​≤ ​$M$​ ≤ 2 000 000 000) from the task.

Output

In a single line, output the number of kids in each of the ​$N$​ teams, respectively from the first to the ​$N$​^{th}^{​} team.

Constraints

In test cases worth a total of 40 points, it will hold ​$M$ ​/ ​$K$ ​≤ 200 000.

Example 1

Input
2 1 3

3 2 7

4 5 6
Output
output
output
2 1

2 3 2

5 1 0 0
Source
COCI 2017/2018 Contest 7
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code