MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / main

Function main

CodeChef_problems/CVDRUN/solution.cpp:12–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include<iostream>
11using namespace std;
12int main() {
13 int t;
14 cin>>t;
15 while(t--){
16 int n,x,y,k,infect=0;
17 cin>>n>>k>>x>>y;
18 int i = n;
19 while(i--){
20 if(x == y){
21 cout<<"YES"<<endl;
22 infect = 1;
23 break;
24 }
25 x = (x+k)%n;
26 }
27 if(!infect){
28 cout<<"NO"<<endl;
29 }
30 }
31 return 0;
32}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected