/* package codechef; // don’t place package name! */
import java.util.;
import java.lang.;
import java.io.*;
/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner scan=new Scanner(System.in);
int t=scan.nextInt();
while(t-->0)
{
int n=scan.nextInt();
Integer arr[]=new Integer[n];
for(int i=0;i<n;i++)
arr[i]=scan.nextInt();
int min=Collections.min(Arrays.asList(arr));
//check if evry element is divisible by min
int count=0;
for(int i=0;i<n;i++)
if(arr[i]%min==0)
count++;
//finding ratios
if(count==n)
{
for(int i=0;i<n;i++)
arr[i]=arr[i]/min;
}
for(int i=0;i<n;i++)
System.out.print(arr[i]+" ");
System.out.println();
}
}
}