#include using namespace std; #include #include #include #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } #define rep(i,n) for (int i = 0; i < (n); ++i) typedef long long ll; typedef long double ld; typedef unsigned long long ull; using P=pair; const ll INF=1e18; const int mod=998244353; void solve(){ ull t,a,b; cin>>t>>a>>b; ull g=__gcd(a,b); ull x1=(t-1)/a; ull x2=(t-1)/b; ull x3=x1/(b/g); cout<