#include<stdio.h>
int hcf(int n,int m)
{
int temp;
if(n<m)
{n=n+m;m=n-m;n=n-m;}
while(n%m!=0)
{
temp=m;
m=n%m;
n=temp;
}
return(m);
}
int main()
{
int t,i,n,j,arr[55],a1;
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%d",&n);
for(j=0;j<n;j++)
scanf("%d",&arr[j]);
a1=arr[0];
for(j=1;j<n;j++)
a1=hcf(a1,arr[j]);
for(j=0;j<n;j++)
printf("%d ",arr[j]/a1);
if(i<t-1)
printf("\n");
}
}
I2luY2x1ZGU8c3RkaW8uaD4KCmludCBoY2YoaW50IG4saW50IG0pCnsKICAgaW50IHRlbXA7CiAgIGlmKG48bSkKICAge249bittO209bi1tO249bi1tO30KICAgd2hpbGUobiVtIT0wKQogICB7CiAgICAgIHRlbXA9bTsKICAgICAgbT1uJW07CiAgICAgIG49dGVtcDsKICAgfQogICByZXR1cm4obSk7Cn0KCmludCBtYWluKCkKewogICBpbnQgdCxpLG4saixhcnJbNTVdLGExOwogICBzY2FuZigiJWQiLCZ0KTsKICAgZm9yKGk9MDtpPHQ7aSsrKQogICB7CiAgICAgIHNjYW5mKCIlZCIsJm4pOwogICAgICBmb3Ioaj0wO2o8bjtqKyspCiAgICAgIHNjYW5mKCIlZCIsJmFycltqXSk7CgogICAgICBhMT1hcnJbMF07CiAgICAgIGZvcihqPTE7ajxuO2orKykKICAgICAgYTE9aGNmKGExLGFycltqXSk7CiAgICAgIAogICAgICBmb3Ioaj0wO2o8bjtqKyspCiAgICAgIHByaW50ZigiJWQgIixhcnJbal0vYTEpOyAKCiAgICAgIGlmKGk8dC0xKQogICAgICBwcmludGYoIlxuIik7CiAgIH0KfQ==