官方题解: 代码如下: #include<bits/stdc++.h> #define fi first #define se second #define mp make_pair #define pb push_back #define LL long long #define pii pair<int,int> #define SZ(x) (int)x.size() #define all(x) x.begin(),x.end() using namespace std; LL gcd(LL a, LL b) {return b ? gcd(b, a %...