Run ID:66911

提交时间:2024-03-11 15:36:42

""" input 7 3 5 7 9 11 13 15 output 17 """ def max_common_divisor(x,y): if x<y: x,y = y,x t = y while t!=1: if x%t==0 and y%t==0: break t -=1 return t n = int(input()) a = list(map(int,input().split())) a.sort() cnt =0 for i in range(n-1): for j in range(i+1,n): ai = a[i] aj = a[j] if max_common_divisor(ai,aj)==1: print( f"{ai}/{aj}") cnt +=1 print(cnt)