#t438. 取牌游戏

取牌游戏

Bessie's Cards

Problem Description

Bessie is playing a card game with her N−1N-1 friends (2≤N≤1002 \le N \le 100), using a deck of KK cards (N≤K≤100000N \le K \le 100000; KK is a multiple of NN). The deck contains M=K/NM = K/N good cards and K−MK - M bad cards. Bessie deals the cards, and of course she wants to take all the good cards for herself, because she likes to win.

Her friends suspect she will cheat, so they impose these rules:

(1) at the start, the top card is dealt to the person on Bessie's right;

(2) after each card is dealt, she must move the next PP cards (1≤P≤101 \le P \le 10), one by one in order, to the bottom of the deck;

(3) continue dealing to every player in a counterclockwise order.

Bessie is eager to win. Help her work out the positions of all the good cards so that she can get them. The cards are numbered 1,2,3,…1, 2, 3, \dots from top to bottom.

Input Format

One line with three space-separated integers: N,K,PN, K, P.

Output Format

MM lines: the positions of the good cards, in increasing order from the top.

Sample Input

3 9 2

Sample Output

3
7
8

Limitation

1 s, 1024 KiB for each test case.