We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cac9dd4 commit abd9d10Copy full SHA for abd9d10
abc.cpp
@@ -0,0 +1,27 @@
1
+#include <iostream>
2
+using namespace std;
3
+
4
+int main() {
5
+ // your code goes here
6
+ int t;
7
+ cin>>t;
8
9
+ while(t--){
10
+ int n,k,x,y;
11
+ cin>>n>>k>>x>>y;
12
+ int flag=0;
13
14
+ for(int i=0;i<n;i++){
15
+ int inf=k*i+x;
16
+ if(inf>n){
17
+ inf=inf%n;
18
+ }
19
+ if(y==inf){
20
+ flag=1;
21
+ break;
22
23
24
25
+ if(flag) cout<<"YES\n";
26
+ else cout<<"NO\n";
27
0 commit comments