My code is giving wrong answer , can someone suggest where I am missing?

problem link: https://www.codechef.com/OCT20B/problems/CVDRUN

My sol:

#include<bits/stdc++.h>

#define ll long long

using namespace std;

int main()

{

ll t;

cin>>t;

while(t–)

{

ll n,k,x,y,steps;

cin>>n>>k>>x>>y;

bool reached =false;

```
if(k==0 && x==y)
reached=true;
else if(k==0 && x!=y)
reached=false;
else
{
if(k!=0)
steps=n/k;
for(ll i=0;i<steps;i++)
{
if((x+(i*k))%n==y)
{
reached=true;
break;
}
else
reached=false;
}
}
cout<<(reached ? "YES" : "NO")<<endl;
}
return 0;
```

}