#include #include #include #include #include #define Maxn 100010 using namespace std; vector x,y; void cal(int n,vector &x){ for(int i=1;i*i<=n;i++){ if(n%i==0){ x.push_back(i); if(i*i!=n) x.push_back(n/i); } } } int main() { int t,a,b,c; cin>>t; while(t--){ x.clear(); y.clear(); cin>>a>>b>>c; cal(a,x); cal(c,y); //for(int i=0;i