set2

n=int(input())
f=list(map(int,input().split()))
res=[]
for i in range(len(f)):
  for j in range(len(f)):
    k=f[i]%f[j]
    res.append(k)
print(max(res),end="")

No comments:

Post a Comment