#include using namespace std; using ll = long long; using P = pair; #define fix(x) fixed << setprecision(x) #define asc(x) x, vector, greater #define rep(i, n) for(ll i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> n; map mp; vector d; for(ll i=1;i*i<=n;i++){ if(n%i) continue; mp[i]++; d.push_back(i); if(i*i!=n){ mp[n/i]++; d.push_back(n/i); } } ll dd = 499122177; for(auto [p,q]:mp){ for(auto x:d){ ll k = x/__gcd(x,p)*p; if(mp.count(k)&&p