#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 mint get(long long a,long long b,long long c){ long long g = gcd(b,c); a /= g; b /= g; c /= g; //cout<c){ mint ret = c; ret -= a/b; ret *= 2; return ret; } else{ return get(((a+c-1)/c)*c,c,b) + 1; } } int main(){ int _t; cin>>_t; rep(_,_t){ long long a,b,c; cin>>a>>b>>c; if(a%b==0&&a%c==0){ cout<<1<