Language: C++

using namespace std;
typedef long long LL;
set<LL> mySet;
bool BuyContinue(LL A,LL B,LL C,LL D)
{
	LL A1=A;
	LL B1=B;
	LL C1=C;
	LL D1=D;
	set<LL>::iterator sit;
	while (true){
		if (A1-B1<0){
			return false;
		}
		LL A2=A1%B1;
		if (A2<=C1){
			A2+=D1;
		}
		sit=mySet.find(A2);
		if (sit!=mySet.end()){
			return true;
		}else{
			mySet.insert(A2);
		}
		A1=A2;
	}

}
int main(int argc, char* argv[])
{
	LL i,T;
	cin>>T;
	vector<LL> A(T),B(T),C(T),D(T);
	for (i=0;i<T;i++){
		cin>>A[i]>>B[i]>>C[i]>>D[i];
	}
	for (i=0;i<T;i++){
		if (A[i]<B[i]){
			cout<<"No"<<endl;
			continue;
		}
		if (B[i]==1){
			cout<<"Yes"<<endl;
			continue;
		}
		if (BuyContinue(A[i],B[i],C[i],D[i])){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
		mySet.clear();
	}
	return 0;
}

Compiler output:
a.cc:3:1: error: 'set' does not name a type
    3 | set<LL> mySet;
      | ^~~
a.cc: In function 'bool BuyContinue(LL, LL, LL, LL)':
a.cc:10:9: error: 'set' was not declared in this scope
   10 |         set<LL>::iterator sit;
      |         ^~~
a.cc:1:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
  +++ |+#include <set>
    1 | using namespace std;
a.cc:10:15: error: expected primary-expression before '>' token
   10 |         set<LL>::iterator sit;
      |               ^
a.cc:10:18: error: '::iterator' has not been declared
   10 |         set<LL>::iterator sit;
      |                  ^~~~~~~~
a.cc:19:17: error: 'sit' was not declared in this scope
   19 |                 sit=mySet.find(A2);
      |                 ^~~
a.cc:19:21: error: 'mySet' was not declared in this scope
   19 |                 sit=mySet.find(A2);
      |                     ^~~~~
a.cc: In function 'int main(int, char**)':
a.cc:32:9: error: 'cin' was not declared in this scope
   32 |         cin>>T;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:33:9: error: 'vector' was not declared in this scope
   33 |         vector<LL> A(T),B(T),C(T),D(T);
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:33:18: error: expected primary-expression before '>' token
   33 |         vector<LL> A(T),B(T),C(T),D(T);
      |                  ^
a.cc:33:20: error: 'A' was not declared in this scope
   33 |         vector<LL> A(T),B(T),C(T),D(T);
      |                    ^
a.cc:33:25: error: 'B' was not declared in this scope
   33 |         vector<LL> A(T),B(T),C(T),D(T);
      |                         ^
a.cc:33:30: error: 'C' was not declared in this scope
   33 |         vector<LL> A(T),B(T),C(T),D(T);
      |                              ^
a.cc:33:35: error: 'D' was not declared in this scope
   33 |         vector<LL> A(T),B(T),C(T),D(T);
      |                                   ^
a.cc:39:25: error: 'cout' was not declared in this scope
   39 |                         cout<<"No"<<endl;
      |                         ^~~~
a.cc:39:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:39:37: error: 'endl' was not declared in this scope
   39 |                         cout<<"No"<<endl;
      |                                     ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:43:25: error: 'cout' was not declared in this scope
   43 |                         cout<<"Yes"<<endl;
      |                         ^~~~
a.cc:43:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:43:38: error: 'endl' was not declared in this scope
   43 |                         cout<<"Yes"<<endl;
      |                                      ^~~~
a.cc:43:38: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:47:25: error: 'cout' was not declared in this scope
   47 |                         cout<<"Yes"<<endl;
      |                         ^~~~
a.cc:47:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:47:38: error: 'endl' was not declared in this scope
   47 |                         cout<<"Yes"<<endl;
      |                                      ^~~~
a.cc:47:38: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:49:25: error: 'cout' was not declared in this scope
   49 |                         cout<<"No"<<endl;
      |                         ^~~~
a.cc:49:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:49:37: error: 'endl' was not declared in this scope
   49 |                         cout<<"No"<<endl;
      |                                     ^~~~
a.cc:49:37: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:51:17: error: 'mySet' was not declared in this scope
   51 |                 mySet.clear();
      |                 ^~~~~