"""
P2651 添加括号III(python3实现)
https://www.luogu.com.cn/problem/P2651
"""
def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
t=int(input())
for i in range(t):
n=int( input() )
a=list( map(int,input().split() ) )
for j in range(n):
if j==1:
continue
tmp=gcd(a[1],a[j])
a[1]=a[1]//tmp
if a[1]==1:
print("Yes")
else:
print("No")
P2651 添加括号III(python3实现)
最新推荐文章于 2024-09-03 20:45:39 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)