欧几里得算法-最大公约数
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
LL gcd(LL a, LL b) {
return !b ? a : gcd(b, a % b);
}
int main() {
int n;
cin >> n;
while (n--) {
LL a, b;
cin >> a >> b;
cout << gcd(a, b) << endl;
}
return 0;
}