[Solution] Beautiful Array Codeforces Solution
Stanley defines the beauty of an array of length , which contains non-negative integers, as follows:
Stanley told Sam the integer and asked him to find an array of non-negative integers, such that the beauty is equal to and the sum of elements is equal to . Help Sam — find any of the arrays satisfying the conditions above.
Each test contains multiple test cases. The first line contains the number of test cases (). Description of the test cases follows.
The first line of each test case contains integers , , , (, , , ).
It is guaranteed that the sum of over all test cases does not exceed .
For each test case print if such array does not exist. Otherwise print non-negative integers () — the answer.
No comments:
Post a Comment