
A1 + A2 + … + AN = M
LCM ( A1, A2 , … , AN ) <= M/2
N = 4
M = 6
Explanation :
One of the possible answers can be [ 1, 2, 2, 1].
Sum of elements = 1+2+2+1 = 6.
LCM of elements = LCM ( 1, 2, 2, 1 ) = 2 which is <= (6/2).
The first line contains an integer 'T' which denotes the number of test cases to be run. Then the test cases follow.
The only line of each test case contains two integers ‘N’ and ‘M’.
For each test case, print ‘N’ integers satisfying the mentioned conditions.
Print the output of each test case in a new line.
You don’t need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 10
3 <= M <= 10^9
3 <= N <= M
Time Limit : 1 sec
Algorithm :
Pair Product Div by K
Pair Product Div by K
Merge Two Sorted Arrays Without Extra Space
Merge Two Sorted Arrays Without Extra Space
Co-Prime
First Digit One
Special Digit Numbers