第 478 场 AtCoder Beginner Contest
葡萄AI (CI翻译)
Problem Statement
题目描述
AI (CI翻译)There are $N$ people numbered from $1$ to $N$.
有 $N$ 个人,编号为 $1$ 到 $N$。AI (CI翻译)
There are $M$ grapes. They will be distributed to the $N$ people as follows.
有 $M$ 颗葡萄,将按照以下方式分给这 $N$ 个人。AI (CI翻译)
- Give one grape each to persons
$1,2,\dots,N$in this order. If the grapes run out midway, the distribution ends at that point. - If there are still grapes remaining after giving to person
$N$, go back to person$1$and distribute in order again. Repeat this until the grapes run out.
- 按照
$1,2,\dots,N$的顺序,依次给每人一颗葡萄。如果中途葡萄分完,则立即结束分配。 - 如果给编号为
$N$的人分完后仍有葡萄剩余,则回到编号为$1$的人,再次按顺序分配。重复这一过程,直到葡萄分完。
Find how many grapes each person receives.
求每个人分到的葡萄数量。AI (CI翻译)
Constraints
约束条件
AI (CI翻译)$1 \leq N \leq 100$$1 \leq M \leq 10000$- All input values are integers.
$1 \leq N \leq 100$$1 \leq M \leq 10000$- 所有输入值均为整数。
Input
输入格式
AI (CI翻译)The input is given from Standard Input in the following format:
输入通过标准输入给出,格式如下:AI (CI翻译)
N M
N MAI (CI翻译)
Output
输出格式
AI (CI翻译)Output $N$ lines. The $i$-th line should contain the number of grapes person $i$ receives.
输出 $N$ 行。第 $i$ 行应包含编号为 $i$ 的人分到的葡萄数量。AI (CI翻译)
样例
Input #1
3 5
Output #1
2
2
1
The five grapes are given one at a time to persons $1,2,3,1,2$ in this order.
Input #2
4 1
Output #2
1
0
0
0
There may be people who receive no grape.
Input #3
12 3456
Output #3
288
288
288
288
288
288
288
288
288
288
288
288
Everyone may receive the same number of grapes.
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。