代码:
#include<bits/stdc++.h>
using namespace std;
inline int gcd(int a,int b){
return !b?a:gcd(b,a%b);
}
int main(){
int n;
scanf("%d",&n);
int ans=0;
for(int i=1;i<=n;i++){
int tmp;
scanf("%d",&tmp);
if(tmp<0) tmp=-tmp;
ans=gcd(ans,tmp);
}
printf("%d\n",ans);
}