问题 4902 --一锐过生日

4902: 一锐过生日

时间限制: 1 Sec  内存限制: 128 MB
提交: 102  解决: 82
[提交][状态][命题人:]

题目描述

一锐马上要过生日了,他打算邀请m个朋友来他家一起过生日。

他相信每个好朋友都会送一份精美的生日礼物给他,

他为了表达谢意,打算把他珍藏多年的n本卡通书拿出来回赠给来参加他生日Party的好朋友们。

为了公平,他希望尽可能让每个好朋友拿到的卡通书差不多,

也就是所有好朋友中拿到的卡通书最多的那一个(假设为x本)和最少的那一个(假设为y本)的差值尽可能的小(即|x-y|这个值尽可能的小)。

如果n正好能够被m整除,那么每个好朋友拿到的卡通书就一样多了。

Polycarpus has got n candies and m friends (nm). He wants to make a New Year present with candies to each friend. 

Polycarpus is planning to present all candies and he wants to do this in the fairest (that is, most equal) manner. 

He wants to choose such ai, where ai is the number of candies in the i-th friend's present, that the maximum ai differs from the least ai as little as possible.

For example, if n is divisible by m, then he is going to present the same number of candies to all his friends, that is, the maximum ai won't differ from the minimum one.

输入

输入两个整数nm (1 ≤ n, m ≤ 100;nm)

The single line of the input contains a pair of space-separated positive integers nm (1 ≤ n, m ≤ 100;nm) — the number of candies and the number of Polycarpus's friends.

输出

输出m个好朋友每人拿到的卡通书的数量,中间空格隔开

Print the required sequence a1, a2, ..., am, where ai is the number of candies in the i-th friend's present. All numbers ai must be positive integers, total up to n, the maximum one should differ from the minimum one by the smallest possible value.

样例输入
Copy
12 3
样例输出
Copy
4 4 4

提示

样例2输入

15 4

样例2输出

3 4 4 4

样例3输入

18 7

样例3输出

2 2 2 3 3 3 3

Print ai in any order, separate the numbers by spaces.

来源

[提交][状态]