Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: iCow
Description Fatigued by the endless toils of farming, Farmer John has decided to try his hand in the MP3 player market with the new iCow. It is an MP3 player that stores - Each song
*i*has an initial rating*R*(1 ≤_{i}*R*≤ 10,000)._{i} - The next song to be played is always the one with the highest rating (or, if two or more are tied, the highest rated song with the lowest index is chosen).
- After being played, a song's rating is set to zero, and its rating points are distributed evenly among the other
*N*-1 songs. - If the rating points cannot be distributed evenly (i.e., they are not divisible by
*N*-1), then the extra points are parceled out one at a time to the first songs on the list (i.e.,*R*_{1},*R*_{2}, etc. -- but not the played song) until no more extra points remain.
Determine the first Input * Line 1: Two space-separated integers: Output * Lines 1.. Sample Input 3 4 10 8 11 Sample Output 3 1 2 3 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator