Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 611 Bytes

README.org

File metadata and controls

30 lines (24 loc) · 611 Bytes

Food lines

There are $N$ lines in the store. Then $M$ people arrive, occupying places in the shortest line. We need to count the number of people in each line.

Inputs

  1. List of food lines with the number of people
  2. Number of people arriving
2 4 5
4

Outputs

Food lines after the distribution of people

5 5 5

Constraints

  • $1 \leq N \leq 100$
  • $1 \leq M \leq 100$
  • $1 \leq a_i \leq 100, i = 1,2,\dotsb,N$

Solutions

C lang