Language: C

int main(void) {
int  t, i, k;
	long long reft,reftd,r,x,y;
	scanf("%d", &t);
	long long  a[300], b[300], c[300], d[300];
	for (i = 0; i <= t-1; i++) {
		scanf("%lld", &a[i]);
		scanf("%lld", &b[i]);
		scanf("%lld", &c[i]);
		scanf("%lld", &d[i]);
 
	}
 
	for (i = 0; i <= t-1; i++) {
		if (a[i] < b[i]) printf("No\n");
		else if (b[i] > d[i]) printf("No\n");
		else if (b[i]-1 <= c[i]) printf("Yes\n");
		else {
			reft = a[i];
			while (reft >= b[i]) {
				reft = reft - b[i];
			}
			if (reft > c[i]) printf("No\n");
			else {
				reftd = d[i];
				while (reftd >= b[i]) {
					reftd = reftd - b[i];
				}
				x = d;
				y = b[i];
				
if(y>x) {y=d; x=b[i]}
				r = x % y;
				while (r != 0) {
					x = y;
					y = r;
					r = x % y;
				}
				k = 0;
				while (reft >= b[i]) {
					if (c[i] < reft < b[i]) k++;
					else;
					reft = reft + y;
				}
				if (k >= 1) printf("No\n");
				else printf("Yes\n");
 
			}
 
		}
 
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         scanf("%d", &t);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void) {
main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         scanf("%d", &t);
      |         ^~~~~
main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:34: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   15 |                 if (a[i] < b[i]) printf("No\n");
      |                                  ^~~~~~
main.c:15:34: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:34: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:34: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:16:39: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   16 |                 else if (b[i] > d[i]) printf("No\n");
      |                                       ^~~~~~
main.c:16:39: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:42: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   17 |                 else if (b[i]-1 <= c[i]) printf("Yes\n");
      |                                          ^~~~~~
main.c:17:42: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:23:42: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   23 |                         if (reft > c[i]) printf("No\n");
      |                                          ^~~~~~
main.c:23:42: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:35: error: assignment to 'long long int' from 'long long int *' makes integer from pointer without a cast [-Wint-conversion]
   29 |                                 x = d;
      |                                   ^
main.c:32:11: error: assignment to 'long long int' from 'long long int *' makes integer from pointer without a cast [-Wint-conversion]
   32 | if(y>x) {y=d; x=b[i]}
      |           ^
main.c:32:21: error: expected ';' before '}' token
   32 | if(y>x) {y=d; x=b[i]}
      |                     ^
      |                     ;
main.c:45:45: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   45 |                                 if (k >= 1) printf("No\n");
      |                                             ^~~~~~
main.c:45:45: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:46:38: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   46 |                                 else printf("Yes\n");
      |                                      ^~~~~~
main.c:46:38: note: include '<stdio.h>' or provide a declaration of 'printf'