T=int(input())

for i in range(1,T+1):

c=0

N=int(input())

A=list(map(int,input().split()))

if(len(A)==N):

```
for v in range(len(A)):
z=v+1
for f in range(z,len(A)):
p=A[f]*A[v]
for k in range(len(A)):
if(p==A[k]):
c=c+1
if(c>=1):
print("yes")
elif(c==0):
print("no")
else:
break
```

please suggest any amends or ways to optimize the given solution so that it doesn’t exceed the time limit…