应为N只有100 N^2 枚举即可
#include<bits/stdc++.h>
using namespace std;
#define fst first
#define sec second
#define sci(num) scanf("%d",&num)
#define scl(num) scanf("%lld",&num)
#define mem(a,b) memset(a,b,sizeof a)
#define cpy(a,b) memcopy(a,b,sizeof b)
typedef long long LL;
typedef pair<int,int> P;
const int MAX_N = 510;
const int MAX_M = 10000;
int gcd (int a, int b) {
if (b == 0) return a;
return gcd(b,a % b);
}
int nums[110];
int main() {
int T;
sci(T);
getchar();
while (T--) {
char
ch;
int num = 0;
int cnt = 0;
string str;
getline(cin, str);
stringstream stream(str);
while (stream >> nums[cnt]) cnt++;
int mg = 1;
for (int i = 0;i < cnt;i++) {
for (int j = i + 1;j < cnt;j++) {
mg = max(mg,gcd(nums[i],nums[j]));
}
}
printf("%d\n",mg);
}
return 0;
}