#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define fast_io ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ; #define ll long long int #define rep(i,n) for(int i=0; i<(int)(n); i++) #define reps(i,n) for(int i=1; i<=(int)(n); i++) #define REP(i,n) for(int i=n-1; i>=0; i--) #define REPS(i,n) for(int i=n; i>0; i--) #define MOD (long long int)(1e9+7) #define INF (int)(1123456789) #define LINF (long long int)(112345678901234567) #define chmax(a, b) a = (((a)<(b)) ? (b) : (a)) #define chmin(a, b) a = (((a)>(b)) ? (b) : (a)) #define all(v) v.begin(), v.end() typedef pair Pii; typedef pair Pll; vector kaijo_memo; double kaijo(ll n){ if(kaijo_memo.size() > n) return kaijo_memo[n]; if(kaijo_memo.size() == 0) kaijo_memo.push_back((double)0); while(kaijo_memo.size() <= n) kaijo_memo.push_back(kaijo_memo[kaijo_memo.size()-1] + log(kaijo_memo.size())); return kaijo_memo[n]; } vector L_kaijo_memo; long double L_kaijo(ll n){ if(L_kaijo_memo.size() > n) return L_kaijo_memo[n]; if(L_kaijo_memo.size() == 0) L_kaijo_memo.push_back((long double)0); while(L_kaijo_memo.size() <= n) L_kaijo_memo.push_back(L_kaijo_memo[L_kaijo_memo.size()-1] + log((long double)L_kaijo_memo.size())); return L_kaijo_memo[n]; } int main(void){ //Flush //M * N! / (N-K)! //Straight //(N-K+1) * K! * M^K //S/F //K! * (N-K+1)! * M^(k-1) / N! ll q;cin>>q; rep(i,q){ ll n,m,k;cin>>n>>m>>k; double S = kaijo(k) + kaijo(n-k+1) + (k-1) * log(m); double F = kaijo(n); long double LS = L_kaijo(k) + L_kaijo(n-k+1) + (k-1) * log((long double)m); long double LF = L_kaijo(n); if(S < F){ cout<<"Straight"<= log(2)); } }