I got a CP problem here that I would like help with
You are given four integers: n, m, s, x.
You need to construct an array of size n such that:
1. All its elements are integers in the range [0, m].
2. The sum of its elements is equal to s.
3. The Bitwise XOR sum of all its elements is equal to x.
Can you do this?
Input:
The first line contains an integer t — the number of test cases (1 <= t <= 10^5).
Then t test cases follow, each containing four integers: n, m, s, x.
(1 <= n <= 10^5)
(0 <= m < 2^30)
(0 <= s <= 10^18)
(0 <= x < 2^30)
It is guaranteed that the sum of n across all test cases does not exceed 3 * 10^5.
Output:
For each test case:
If it is impossible to construct an array that meets the conditions, print -1.
Otherwise, print n integers on a single line — the array that satisfies the conditions.
Sample Input
3
4 4 15 7
4 4 4 4
4 4 15 1
Sample Output
4 4 4 3
4 0 0 0
-1```