AT_abc478_a.Grapes
入门
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
There are N people numbered from 1 to N.
There are M grapes. They will be distributed to the N people as follows.
- Give one grape each to persons 1,2,…,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.
Find how many grapes each person receives.
有 N 个人,编号为 1 到 N。
共有 M 颗葡萄。这些葡萄将按如下方式分发给这 N 个人:
- 按顺序依次给第 1,2,…,N 号人每人分发一颗葡萄。若中途葡萄用尽,则分发立即结束。
- 若在给第 N 号人分发后仍有剩余葡萄,则回到第 1 号人,再次按顺序分发。重复此过程,直至葡萄全部分完。
求每个人最终分得的葡萄数量。
输入格式
The input is given from Standard Input in the following format:
N M
输入从标准输入中以如下格式给出:
N M
输出格式
Output N lines. The i-th line should contain the number of grapes person i receives.
输出 N 行。第 i 行应包含第 i 个人收到的葡萄数量。
输入输出样例
输入#1
3 5
输出#1
2 2 1
输入#2
4 1
输出#2
1 0 0 0
输入#3
12 3456
输出#3
288 288 288 288 288 288 288 288 288 288 288 288
说明/提示
Sample 1 Explanation:
The five grapes are given one at a time to persons 1,2,3,1,2 in this order.
Sample 2 Explanation:
There may be people who receive no grape.
Sample 3 Explanation:
Everyone may receive the same number of grapes.
Constraints
- 1≤N≤100
- 1≤M≤10000
- All input values are integers.
样例 1 解释:
五个葡萄按顺序依次分给编号为 1,2,3,1,2 的人。
样例 2 解释:
可能存在未收到任何葡萄的人。
样例 3 解释:
每个人收到的葡萄数量可能相同。
约束条件
- 1≤N≤100
- 1≤M≤10000
- 所有输入值均为整数。
输入解题思路,AI测评打分。不知道怎么写?