You are tasked with finding a sequence of non-negative integers of length ( N ) that allows a specific operation to be performed exactly ( K ) times. The operation is defined as follows:
Identify the largest element in the sequence. If there are multiple occurrences of the largest element, choose one arbitrarily.
Decrease the value of this largest element by ( N ) and increase each of the other elements in the sequence by 1.
Repeat this operation until the largest element in the sequence is ( N-1 ) or smaller.
It is guaranteed that a sequence satisfying the conditions can always be constructed under the provided constraints.
Input Format
An integer ( N ) (the length of the sequence) where ( 1 \leq N \leq 1000).
An integer ( K ) (the number of required operations) where ( 1 \leq K \leq 1000).
Output Format
Output a sequence of ( N ) non-negative integers ( a_1, a_2, \ldots, a_N ) that can be operated upon exactly ( K ) times as described. Each integer ( a_i ) should satisfy the condition ( 0 \leq a_i ).
Example
Input
text
N = 5
K = 3
Output
text
[7, 0, 0, 0, 0]
Explanation
Initial Sequence: [7, 0, 0, 0, 0]
Operation 1: Decrease 7 by 5 (new sequence: [2, 1, 1, 1, 1])
Operation 2: Decrease 2 by 5 (new sequence: [-3, 2, 2, 2, 2])
Operation 3: Decrease 2 by 5 (new sequence: [-8, 3, 3, 3, 3])
After 3 operations, the largest element in the sequence has become ( N-1 ) (which is 4).
Constraints
You must ensure that the output sequence can be operated on exactly ( K ) times.
The sequence elements must be non-negative integers.
Solution
Place your solution code in the /app/ directory of your project.
Important: place your implementation at /app/solution.py so the verifier can run it.