RE (SIGFPE)

I am trying to solve this question CVDRUN Problem - CodeChef

but getting RE while submitting
here is my solution

#include
#include <bits/stdc++.h>
using namespace std;

int main()
{
long long int t,n,k,x,y;
cin>>t;
for(long long int i=0;i<t;i++)
{
cin>>n>>k>>x>>y;
long long int d;
d=y-x;
if(n%k!=0)
{
cout<<“YES”;
}
if(n%k==0)
{

        if(d%k==0)
        {
            cout<<"YES";
        }
        else if(d%k!=0)
        {
            cout<<"NO";
        }
    }
    cout<<"\n";
}
// your code goes here
return 0;

}

https://www.codechef.com/viewsolution/38926563

k can be 0, so you can’t write d%k or n%k, you can read more about sigfpe error on this Why do I get a SIGFPE?