#C7744. Equal Candy Distribution

    ID: 51649 Type: Default 1000ms 256MiB

Equal Candy Distribution

Equal Candy Distribution

You are given two integers \(c\) and \(b\) representing the total number of candies and the number of bowls respectively. Your task is to distribute \(c\) candies among \(b\) bowls as equally as possible such that:

  • Each bowl gets at least \(\lfloor c/b \rfloor\) candies.
  • If there is a remainder \(r = c \mod b\), then the first \(r\) bowls (in order) will receive one additional candy.

It is guaranteed that \(b \geq 1\) and \(c \geq 0\). The result should be output as a sequence of \(b\) integers (space-separated) representing the number of candies in each bowl.

For example, if \(c = 12\) and \(b = 5\), the distribution would be: \(3\ 3\ 2\ 2\ 2\).

inputFormat

The input consists of a single line with two space-separated integers:

  • \(c\): the total number of candies.
  • \(b\): the number of bowls.

outputFormat

Output a single line containing \(b\) space-separated integers representing the number of candies in each bowl as per the distribution rules stated above.

## sample
10 5
2 2 2 2 2