Error cehcking

I have solution for the questions in the long challenge but I am getting error even logic is correct.

contest name:-
DEC221

Div 4 6th question

Question code:-
DIVISIBLEBY

code:-

T=int(input())
while T!=0:

  N=int(input())
  A=input().split()
  for i in range(len(A)):
      A[i]=int(A[i])
  m=min(A)
  c=0
  for i in range(len(A)):
      if A[i]%m!=0:
          c=1
          break
  if c==0:
      for i in range(len(A)):
          print(int(A[i]/m),end=' ')
  elif c==1:
      for i in range(len(A)):
          print(int(A[i]),end=' ')
  print()
  T=T-1