#include using namespace std; using ll=long long; int main(){ int ttt; cin>>ttt; while(ttt--){ ll n,p,k; cin>>n>>p>>k; bool ans=false; { if(k%p==0&&(n/5)*p>=k)ans=true; } if(n>=5){ k-=(p-1); n-=5; if(k%p==0&&(n/5)*p>=k)ans=true; } if(ans)cout<<"Yes"<