Closed Mahi1901 closed 2 years ago
Kasturi Mandlik Cummins college of engineering for women Dept: Electronics and telecommunication I would like to work on this issue. Can you please assign me this issue?
Janhavi Gadre Cummins college of engineering for women Dept: Computer I would like to work on this issue. Can you please assign me this issue?
Nikita Miraje Cummins college of engineering for women Dept: Electronics and telecommunication I would like to work on this issue. Can you please assign me this issue?
@Mahi1901 Can you please assign me this issue?
Manasi Deshmukh Cummins college of engineering for women Dept: Computer Engineering I would like to work on this issue. Can you please assign me this issue?
Shrutika Kaperavenollu CCOEW IT I would like to work on this issue. Can you please assign me this issue?
I have assigned. Happy coding!
@Mahi1901 I have completed my assignment. Please do check and merge my pull request.
HEY!!! This is Aditi Sharma(SY-C) MKSSS's CCOEW Computer Engineering
I want to work on this issue Can you assign this to me?
Sasuke and Itachi are playing a game. Sasuke first creates an array AA containing NN positive integers A1, A2,…,AN. He then creates a new array BB of length NN such that Bi=gcd (A1 ,A2,...,Ai) for each 1≤i≤N. Now, Sasuke gives array BB to Itachi and asks him to find any array AA (with 1≤Ai≤10^9) such that the given process applied to AA will produce BB. Can you help Itachi solve this problem? Here, gcd stands for greatest common divisor.
Input Format The first line of the input contains a single integer TT denoting the number of test cases. The description of TT test cases follows. The first line of each test case contains a single integer NN. The second line contains NN space-separated integers B1, B2,…,BN
Output Format For each test case, print a single line containing NN space-separated integers denoting the array AA you constructed. If no such array AA exists, print -1 instead.
Constraints 1≤T≤10^3 1≤N≤10^5 1≤Ai, Bi≤10^9
It is guaranteed that sum of NN over all test cases doesn't exceed 5×10^5.
Sample 1: Input 2 2 4 2 2 1 3 Output 4 26 -1