#include<bits/stdc++.h>
using namespace std;
int gcd(int a, int b){
if(a%b==0) return b;
return gcd(b,a%b);
}
int main()
{
int n,a[101];
cin>>n;
string s;
getchar();
while(n--){
getline(cin,s);
istringstream iss(s);
int N = 0;
int ans=0;
while(iss>>a[N]) ++N;
for(int i=0;i<N;i++)
{
for(int j=i+1;j<N;j++)
{
ans=max(ans,gcd(a[i],a[j]));
}
}
cout<<ans<<endl;
}
return 0;
}
0 comments :
Post a Comment