AT_abc478_a.Grapes

入门

通过率:0%

时间限制:2.00s

内存限制:1024MB

AC君温馨提醒

该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

There are NN people numbered from 11 to NN.

There are MM grapes. They will be distributed to the NN people as follows.

  • Give one grape each to persons 1,2,…,N1,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 NN, go back to person 11 and distribute in order again. Repeat this until the grapes run out.

Find how many grapes each person receives.

有 NN 个人,编号为 11 到 NN。

共有 MM 颗葡萄。这些葡萄将按如下方式分发给这 NN 个人:

  • 按顺序依次给第 1,2,…,N1, 2, \dots, N 号人每人分发一颗葡萄。若中途葡萄用尽,则分发立即结束。
  • 若在给第 NN 号人分发后仍有剩余葡萄,则回到第 11 号人,再次按顺序分发。重复此过程,直至葡萄全部分完。

求每个人最终分得的葡萄数量。

输入格式

The input is given from Standard Input in the following format:

NN MM

输入从标准输入中以如下格式给出:

NN MM

输出格式

Output NN lines. The ii-th line should contain the number of grapes person ii receives.

输出 NN 行。第 ii 行应包含第 ii 个人收到的葡萄数量。

输入输出样例

  • 输入#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,21,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≤1001 \leq N \leq 100
  • 1≤M≤100001 \leq M \leq 10000
  • All input values are integers.

样例 1 解释:
五个葡萄按顺序依次分给编号为 1,2,3,1,21,2,3,1,2 的人。

样例 2 解释:
可能存在未收到任何葡萄的人。

样例 3 解释:
每个人收到的葡萄数量可能相同。

约束条件

  • 1≤N≤1001 \leq N \leq 100
  • 1≤M≤100001 \leq M \leq 10000
  • 所有输入值均为整数。

输入解题思路,AI测评打分。不知道怎么写?

首页