You have $a$ coins of value $n$ and $b$ coins of value $1$. You always pay in exact change, so you want to know if there exist such $x$ and $y$ that if you take $x$ ($0 \le x \le a$) coins of value $n$ and $y$ ($0 \le y \le b$) coins of value $1$, then the total value of taken coins will be $S$.

You have to answer $q$ independent test cases.


-----Input-----

The first line of the input contains one integer $q$ ($1 \le q \le 10^4$) — the number of test cases. Then $q$ test cases follow.

The only line of the test case contains four integers $a$, $b$, $n$ and $S$ ($1 \le a, b, n, S \le 10^9$) — the number of coins of value $n$, the number of coins of value $1$, the value $n$ and the required total value.


-----Output-----

For the $i$-th test case print the answer on it — YES (without quotes) if there exist such $x$ and $y$ that if you take $x$ coins of value $n$ and $y$ coins of value $1$, then the total value of taken coins will be $S$, and NO otherwise.

You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES will all be recognized as positive answer).


-----Example-----
Input
4
1 2 3 4
1 2 3 6
5 2 6 27
3 3 5 18

Output
YES
NO
NO
YES

Difficulty: EASY

Solutions:
import math
t = int(input())
while t:
	(a, b, n, s) = map(int, input().split())
	k = s // n
	k = min(k, a)
	if b >= s - k * n:
		print('YES')
	else:
		print('NO')
	t -= 1


t = int(input())
while t:
	(a, b, n, s) = map(int, input().rstrip().split(' '))
	if s % n > b:
		print('NO')
	elif a * n + b < s:
		print('NO')
	else:
		print('YES')
	t -= 1


def gg(k):
	if k * n > s:
		return True
	else:
		return False
q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	l = -1
	r = a + 1
	while l + 1 < r:
		m = (l + r) // 2
		if gg(m):
			r = m
		else:
			l = m
	if l <= a and l * n <= s and (l * n + b >= s):
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(a, b, n, S) = map(int, input().split())
	g = S // n * n
	if a * n + b >= S and b >= S - g:
		print('YES')
	else:
		print('NO')


n = int(input())
for _ in range(n):
	l = list(map(int, input().split()))
	a = l[0]
	n = l[2]
	b = l[1]
	s = l[3]
	t = 0
	p = s // n
	if p <= a:
		t += p * n
	else:
		t += a * n
	if s - t <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	val = int(s / n)
	x = min(val, a)
	s -= x * n
	if s > b:
		print('NO')
	else:
		print('YES')


exec("for _ in range(int(input())):\n\ta,b,n,s=list(map(int,input().split()));r=s-n*min(a,s//n)-b\n\tprint('YNEOS'[r>0::2])")


def test_magic(li, n):
	for i in range(n):
		m = int(li[i][0])
		n = int(li[i][1])
		p = int(li[i][2])
		q = int(li[i][3])
		result = 'YES'
		if (q - n) / p > m:
			result = 'NO'
		elif q % p > n:
			result = 'NO'
		print(result)
n = int(input())
list1 = []
for i in range(n):
	list1.append(input().split(' '))
test_magic(list1, n)


def rr():
	return input().rstrip()

def rri():
	return int(rr())

def rrl():
	return list(map(int, rr().split()))

def rrt():
	return tuple(map(int, rr().split()))
from collections import defaultdict

def mus(d=0):
	return defaultdict(defaultdict(d))

def ms(x, y, d=0):
	return [[0] * y for i in range(x)]

def ar(x, d=0):
	return [d] * x

def ppm(m, n=0, x=0, y=0):
	print('\n'.join(('\t'.join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))

def ppa(a, n):
	print('\t'.join(map(str, a[0:n])))

def ppl(a=0, x=[1]):
	x[0] = a or x[0] + 1
	print('-' + '- -' * 14 + '-# ' + str(x[0] - 2) + ' #-' + '- -' * 14 + '-')

def yn(x):
	return 'YES' if x else 'NO'
from itertools import accumulate
from itertools import groupby

def grp(x):
	return ((i, sum((1 for _ in g))) for (i, g) in groupby(x))
import math

def rnar():
	return (*rrl(), rrl())

def rn():
	return (*rrl(),)

def read():
	return rn()

def solve(a, b, n, s):
	am_a = s // n
	am_b = s - min(am_a, a) * n
	ans = am_b <= b
	return yn(ans)
test_count = rri()
for _ in range(test_count):
	input_data = read()
	result = solve(*input_data)
	print(result)


t = int(input())
for i in range(t):
	(a, b, n, s) = [int(x) for x in input().split()]
	acoins = s // n
	if acoins > a:
		sum = 0
		sum += a * n
		if s - sum <= b:
			print('YES')
		else:
			print('NO')
	else:
		rem = s % n
		if rem <= b:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	x = s - n * a
	if x >= 0:
		if b < x:
			print('NO')
		else:
			print('YES')
	elif b < s % n:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	(a, b, n, s) = map(int, input().split())
	c = s // n
	if c <= a:
		s = s - n * c
	else:
		s = s - n * a
	if s <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	t = t - 1
	(a, b, n, s) = map(int, input().split())
	x = s // n
	if x > a:
		x = a
	y = s - x * n
	if y <= b and y >= 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = [int(__) for __ in input().split()]
	if s > a * n + b:
		print('NO')
		continue
	if s % n > b:
		print('NO')
	else:
		print('YES')


a = []
n = int(input())
for i in range(n):
	a.append(map(int, input().split()))
for j in range(n):
	b = [a for a in a[j]]
	p = b[0]
	q = b[1]
	r = b[2]
	s = b[3]
	if p * r == s:
		print('YES')
	if p * r < s:
		if s - p * r <= q:
			print('YES')
		else:
			print('NO')
	if p * r > s:
		z = int(s / r)
		if s - z * r <= q:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	ans = s // n
	coins = min(ans, a)
	if s - coins * n <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	(a, n) = (n, a)
	check = False
	sum = min(s // a, n)
	check = sum * a + b
	if check >= s:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, n, S) = map(int, input().split())
	k = a * n + b
	if k < S:
		print('NO')
	elif k == S:
		print('YES')
	elif S % n <= b:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	arr = list(map(int, input().strip().split()))[:4]
	(a, b, n, s) = (arr[0], arr[1], arr[2], arr[3])
	no_coins = s // n
	fin_coin = 0
	if no_coins > a:
		fin_coins = a
	else:
		fin_coins = no_coins
	sum1 = fin_coins * n
	if sum1 + b >= s:
		print('YES')
	else:
		print('NO')


Q = int(input())
for _ in range(Q):
	(a, b, n, S) = list(map(int, input().split()))
	left = S - min(a, S // n) * n
	if left <= b:
		print('YES')
	else:
		print('NO')


import math
q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	ll = math.ceil((max(0, s - a * n) - s % n) / n)
	rl = (min(s, b) - s % n) // n
	if ll > rl:
		print('NO')
	else:
		print('YES')


t = int(input())
while t > 0:
	(a, b, n, s) = [int(x) for x in input().split()]
	maxi = a * n + b
	if s <= maxi:
		kit = s % n
		if kit <= b:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	t -= 1


import random

def get_many_ints():
	return map(int, input().split())

def get_int():
	return int(input())

def get_int_list():
	return list(get_many_ints)

def prog():
	(a, b, n, S) = get_many_ints()
	a -= S // n
	b -= S % n
	b -= max(0, -a) * n
	print('NO' if b < 0 else 'YES')
q = get_int()
for _ in range(q):
	prog()


import os
import sys
DEBUG = 'DEBUG' in os.environ

def inp():
	return sys.stdin.readline().rstrip()

def read_int():
	return int(inp())

def read_ints():
	return [int(e) for e in inp().split()]

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)

def main():
	(a, b, n, S) = read_ints()
	a_max = S // n
	if a > a_max:
		b_needed = S - a_max * n
	else:
		b_needed = S - a * n
	if b >= b_needed:
		return 'YES'
	else:
		return 'NO'
for _ in range(read_int()):
	print(main())


IN = lambda : list(map(int, input().split()))
q = int(input())
for _ in range(q):
	(a, b, n, S) = IN()
	num_a = min(S // n, a)
	if S - num_a * n <= b:
		print('YES')
	else:
		print('NO')


n_q = int(input())
for i in range(n_q):
	data = input()
	case_data = [int(x) for x in data.split()]
	total_n = case_data[0] * case_data[2]
	if case_data[3] == total_n:
		print('YES')
		continue
	elif case_data[3] > total_n:
		if case_data[3] - total_n <= case_data[1]:
			print('YES')
			continue
	elif case_data[3] < total_n:
		if case_data[3] - case_data[3] // case_data[2] * case_data[2] <= case_data[1]:
			print('YES')
			continue
	print('NO')


def solve(a, b, n, s):
	if s % n <= b and a * n + b >= s:
		return True
	return False
q = int(input())
for _ in range(q):
	(a, b, n, s) = list(map(int, input().split()))
	if solve(a, b, n, s):
		print('YES')
	else:
		print('NO')


num = int(input())
for testcase in range(1, num + 1):
	[a, b, n, S] = [int(i) for i in input().split()]
	S -= n * min(a, S // n)
	if S > b:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(a, b, n, S) = map(int, input().split())
	if b >= S % n and a * n + b >= S:
		print('YES')
	else:
		print('NO')


def main():
	n = int(input())
	ans = []
	for i in range(n):
		v = [int(x) for x in input().split()]
		if v[3] == 0:
			ans.append('YES')
		elif v[0] == 0 and v[1] == 0:
			ans.append('NO')
		else:
			r = v[3] % v[2]
			q = v[3] // v[2]
			if v[0] >= q and v[1] >= r:
				ans.append('YES')
			elif v[0] >= q and v[1] < r:
				ans.append('NO')
			else:
				k = v[3] - v[0] * v[2]
				if v[1] >= k:
					ans.append('YES')
				else:
					ans.append('NO')
	for a in ans:
		print(a)
main()


m = int(input())
for i in range(m):
	(a, b, n, S) = [int(x) for x in input().split(' ')]
	if a * n + b < S:
		print('NO')
	elif S % n > b:
		print('NO')
	else:
		print('YES')


n = int(input())
T = []
for i in range(n):
	T.append(input().split())
for i in T:
	a = int(i[0])
	b = int(i[1])
	n = int(i[2])
	S = int(i[3])
	if a * n + b < S:
		print('NO')
	else:
		m = S // n
		if m > a:
			if S - a * n > b:
				print('NO')
			else:
				print('YES')
		elif S - m * n > b:
			print('NO')
		else:
			print('YES')


import sys
q = int(sys.stdin.readline())
for i in range(q):
	line = sys.stdin.readline().split(' ')
	a = int(line[0])
	b = int(line[1])
	n = int(line[2])
	S = int(line[3])
	maxA = S // n
	if a > maxA:
		aValue = n * maxA
		if aValue + b >= S:
			print('YES')
			continue
	else:
		aValue = a * n
		if b >= S - aValue:
			print('YES')
			continue
	print('NO')


q = int(input())
for i in range(q):
	str = input()
	a = int(str.rsplit(' ')[0])
	b = int(str.rsplit(' ')[1])
	n = int(str.rsplit(' ')[2])
	s = int(str.rsplit(' ')[3])
	if s % n <= b and s <= a * n + b:
		print('YES')
	else:
		print('NO')


import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return list(map(int, minp().split()))

def solve():
	(a, b, n, S) = mints()
	d = S // n
	r = S % n
	d = min(a, d)
	print(['NO', 'YES'][S - d * n <= b])
for i in range(mint()):
	solve()


t = int(input())
for z in range(t):
	(a, b, n, S) = map(int, input().split())
	x = min(a, S // n)
	cl = S - x * n
	if cl <= b:
		print('YES')
	else:
		print('NO')


qq = int(input())
for q in range(qq):
	(a, b, n, s) = map(int, input().split())
	x = s // n
	if x > a:
		x = a
	y = s - x * n
	if y > b:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if a * c + b >= d:
		if d % c <= b:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


q = int(input())
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	t = S % n
	if t > b:
		print('NO')
	elif (S - t) // n > a + (b - t) // n:
		print('NO')
	else:
		print('YES')


tests = int(input())
for _ in range(tests):
	(a, b, n, S) = list(map(int, input().split()))
	rest = S // n
	remainder = S % n
	if min(a, rest) * n + b >= S:
		print('YES')
	else:
		print('NO')


num_cases = int(input())

def output(a, b, n, S):
	a = a if S // n > a else S // n
	if S - a * n <= b:
		print('YES')
	else:
		print('NO')
for i in range(num_cases):
	numbers = [int(num) for num in input().split()]
	output(numbers[0], numbers[1], numbers[2], numbers[3])


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	if a * n + b < s or s % n > b:
		print('NO')
	else:
		print('YES')


amount = int(input())
for i in range(amount):
	(a, b, n, s) = [int(s) for s in input().split()]
	if s - n * min(a, s // n) <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	t -= 1
	(a, b, n, s) = map(int, input().split())
	req = 0
	if s // n <= a:
		req = s % n
	else:
		req = s - a * n
	if req > b:
		print('NO')
	else:
		print('YES')


def inp(dtype=str, strip=True):
	s = input()
	res = [dtype(p) for p in s.split()]
	res = res[0] if len(res) == 1 and strip else res
	return res

def problem1():
	q = inp(int)
	for _ in range(q):
		(a, b, n, S) = inp(int)
		S = S - min(S // n * n, a * n)
		if S <= b:
			print('YES')
		else:
			print('NO')

def problem2():
	pass

def problem3():
	pass

def problem4():
	pass
problem1()


t = int(input())
for i in range(t):
	(a, b, n, S) = map(int, input().split())
	d = min(S // n, a)
	d = S - d * n
	if d <= b:
		print('YES')
	else:
		print('NO')


for u in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	x = s // n
	y = min(x, a)
	d = s - y * n
	if b >= d:
		print('YES')
	else:
		print('NO')


Q = int(input())
for q in range(Q):
	(a, b, n, S) = [int(x) for x in input().split()]
	e = S // n
	if e <= a:
		f = S % n
		if f <= b:
			print('YES')
		else:
			print('NO')
	elif S - a * n <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b, n, s) = [int(i) for i in input().split()]
	if s % n > b:
		print('NO')
	elif a * n + b * 1 >= s:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	X = list(map(int, input().split()))
	print('YES' if X[-1] - min(X[0], X[-1] // X[2]) * X[2] <= X[1] else 'NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	maxi = n * a
	rem = s % n
	z = s // n * n
	z = min(z, a * n)
	if s - z <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
i = 0
while i < t:
	(a, b, n, S) = map(int, input().split())
	d = S - a * n
	if d >= 0:
		if b >= d:
			print('YES')
		else:
			print('NO')
	elif S % n <= b:
		print('YES')
	else:
		print('NO')
	i += 1


import sys
ans = ''
for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if a * n + b >= s:
		if s % n <= b:
			ans += 'YES\n'
		else:
			ans += 'NO\n'
	else:
		ans += 'NO\n'
print(ans)


n = int(input())
for i in range(n):
	sums = 0
	(a, b, n, s) = [int(i) for i in input().split()]
	c = s // n
	if c > a:
		c = a
	sums = c * n + b
	if sums >= s:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(a, b, n, S) = map(int, input().split())
	asum = min(S // n, a)
	if S - asum * n <= b:
		print('YES')
	else:
		print('NO')


import math, sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))
I = lambda : int(input())
S = lambda : input()
t = I()
for i in range(0, t):
	(a, b, n, s) = li()
	if s % n > b:
		print('NO')
	elif a * n + b >= s:
		print('YES')
	else:
		print('NO')


tests = int(input())
test_cases = []
for n in range(tests):
	l = input()
	case = [int(i) for i in l.split(' ')]
	n_needed = case[3] // case[2]
	n_have = min(n_needed, case[0])
	rest = case[3] - n_have * case[2]
	if rest > case[1]:
		print('NO')
	else:
		print('YES')


q = int(input())
for i in range(q):
	s1 = 0
	f = [int(j) for j in input().split(' ')]
	a = f[0]
	b = f[1]
	n = f[2]
	s = f[3]
	s1 = n * a + b
	if s1 < s:
		print('NO')
	elif s1 == s:
		print('YES')
	elif s <= a * n:
		k1 = s % n
		if b >= k1:
			print('YES')
		else:
			print('NO')
	else:
		s2 = s // n
		s2 -= a
		b -= s2 * n
		k2 = s % n
		if b >= k2:
			print('YES')
		else:
			print('NO')


n = int(input())
for sas in range(n):
	(a, b, n, s) = map(int, input().split())
	if s - min(s // n, a) * n <= b:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	xn = min(s // n, a)
	if xn * n + b < s or s - xn * n > b:
		print('NO')
	else:
		print('YES')


q = int(input())
for _ in range(q):
	(a, b, n, S) = [int(x) for x in input().split()]
	x = S // n
	y = S - n * x
	if a * n + b >= S:
		if x <= a and y <= b:
			print('YES')
		elif x > a and y <= b and (a * n + b >= S):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


q = int(input())
for _ in range(q):
	L = list(map(int, input().split()))
	if L[0] * L[2] + L[1] >= L[3] and L[3] % L[2] <= L[1]:
		print('YES')
	else:
		print('NO')


n = int(input())

def main():
	(a, b, n, S) = map(int, input().split())
	judge2 = a * n + b >= S
	judge1 = S % n <= b
	if judge1 and judge2:
		print('YES')
	else:
		print('NO')
for i in range(n):
	main()


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	k = s // n
	if k <= a:
		j = s % n
		if j <= b:
			print('YES')
		else:
			print('NO')
	elif b >= s - a * n:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	l = list(map(int, input().split()))
	x = l[3] // l[2]
	y = l[3] % l[2]
	if x <= l[0]:
		if y <= l[1]:
			print('YES')
		else:
			print('NO')
	else:
		z = l[3] - l[1]
		if z <= l[0] * l[2]:
			print('YES')
		else:
			print('NO')


c = int(input())
for i in range(c):
	l = list(map(int, input().split()))
	count = l[3] // l[2]
	l[3] -= min(count, l[0]) * l[2]
	if l[3] > l[1]:
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	l = list(map(int, input().split()))
	(a, b, n, S) = (l[0], l[1], l[2], l[3])
	q = S // n
	r = S % n
	if q <= a and r <= b:
		print('YES')
	elif q > a and r <= b:
		if a * n + b >= S:
			print('YES')
		else:
			print('NO')
	elif r == 0:
		if q <= a:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
while t:
	(a, b, n, s) = map(int, input().split())
	r = a * n
	if r <= s:
		s = s - r
	else:
		s = s % n
	if s <= b:
		print('YES')
	else:
		print('NO')
	t -= 1


for i in range(int(input())):
	clist = list(map(int, input().split()))
	if clist[0] * clist[2] + clist[1] < clist[3]:
		print('NO')
	elif clist[0] * clist[2] < clist[3]:
		if clist[0] * clist[2] + clist[1] < clist[3]:
			print('NO')
		else:
			print('YES')
	else:
		rem = clist[3] % clist[2]
		if clist[1] >= rem:
			print('YES')
		else:
			print('NO')


d = int(input())
ltot = []
for k in range(d):
	l = list(map(int, input().split()))
	ltot.append(l)

def yesorno(x, y, xval, val):
	cond = False
	mod = val % xval
	if x * xval + y >= val:
		if y >= mod:
			cond = True
	return cond
for i in range(len(ltot)):
	ls = ltot[i]
	a = ls[0]
	b = ls[1]
	n = ls[2]
	s = ls[3]
	if yesorno(a, b, n, s) == True:
		print('YES')
	else:
		print('NO')


q = int(input())
for x in range(q):
	(a, b, n, S) = input().split()
	a = int(a)
	b = int(b)
	n = int(n)
	S = int(S)
	quotient = S // n
	if quotient > a:
		if b >= S - a * n:
			print('YES')
		else:
			print('NO')
	elif b >= S - n * quotient:
		print('YES')
	else:
		print('NO')


import collections
import itertools
import sys
from bisect import bisect_left
from collections import defaultdict, Counter
from math import sqrt, ceil
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def find_lt(a, x):
	i = bisect_left(a, x)
	if i:
		return i
	return -1

def main():
	n = inp()
	for _ in range(n):
		(a, b, n, s) = inlt()
		m = min(s // n, a)
		if m * n + b >= s:
			print('YES')
		else:
			print('NO')
main()


for i in range(int(input())):
	string = list(map(int, input().split()))
	(a, b, n, s) = string
	if n > s:
		if b >= s:
			print('YES')
		else:
			print('NO')
	elif a * n > s:
		if s % n <= b:
			print('YES')
		else:
			print('NO')
	elif a * n + b >= s:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, S) = map(int, input().split())
	maxPossible = a * n + b
	if maxPossible < S:
		print('NO')
	elif maxPossible == S:
		print('YES')
	elif a * n <= S:
		if a * n + b >= S:
			print('YES')
		else:
			print('NO')
	else:
		fac = S // n
		rem = S - n * fac
		if rem <= b:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	(x, y) = (s // n, s % n)
	print(['NO', 'YES'][x <= a and y <= b or (x > a and b >= s - a * n)])


import sys
input = sys.stdin.readline
q = int(input())
for i in range(q):
	(w, e, r, t) = map(int, input().split())
	if t - min(w, t // r) * r > e:
		print('NO')
	else:
		print('YES')


o1 = 0
o2 = 0
for i in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	o1 = min(a, s // n)
	o2 = min(s - o1 * n, b)
	if o1 * n + o2 == s:
		print('YES')
	else:
		print('NO')


q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	if n <= s:
		p = s // n
		r = s % (n * p)
		if p > a:
			if (p - a) * n <= b - r:
				print('YES')
			else:
				print('NO')
		elif r <= b:
			print('YES')
		else:
			print('NO')
	elif b >= s:
		print('YES')
	else:
		print('NO')


q = int(input())
for j in range(q):
	(a, b, n, s) = map(int, input().split(' '))
	k = 0
	i = 0
	t = min(s // n, a)
	if t * n + b >= s:
		print('YES')
	else:
		print('NO')


n = int(input())
i = 0
while i < n:
	l = list(map(int, input().split()))
	i += 1
	if (l[3] // l[2] <= l[0] or l[1] >= l[3] - l[2] * l[0]) and l[3] % l[2] <= l[1]:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(0, q):
	t = 'YES'
	(a, b, n, s) = map(int, input().split())
	if a * n + b < s:
		t = 'NO'
	elif s % n > b:
		t = 'NO'
	print(t)


from math import *
from copy import *
from string import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
T = int(input())
for _ in range(T):
	(a, b, N, S) = list(map(int, stdin.readline().rstrip().split()))
	if a * N + b < S:
		print('NO')
	elif S <= b:
		print('YES')
	elif S // N <= a and S - S // N * N <= b:
		print('YES')
	elif S // N > a and S - S // N * N <= b:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(kn, k1, n, s) = [int(k) for k in input().split()]
	nk = s // n
	if nk <= kn:
		s -= nk * n
	else:
		s -= kn * n
	if s > k1:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	(a, b, n, s) = input().split(' ')
	a = int(a)
	b = int(b)
	n = int(n)
	s = int(s)
	if a * n + b >= s and s % n <= b:
		print('YES')
	else:
		print('NO')


def change(a, b, n, S):
	x = S // n
	if x <= a and b >= S % n:
		return 'YES'
	elif x > a and b >= S - a * n:
		return 'YES'
	else:
		return 'NO'
t = int(input())
for i in range(t):
	(a, b, n, S) = map(int, input().split())
	print(change(a, b, n, S))


for t in range(int(input())):
	(a, b, n, s) = [int(x) for x in input().split(' ')]
	sm = min(s // n, a) * n
	s -= sm
	if b >= s:
		print('YES')
	else:
		print('NO')


q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().rstrip().split())
	if a * n > s:
		d = s // n
		print('YES' if d * n + b >= s else 'NO')
	else:
		print('YES' if a * n + b >= s else 'NO')


t = int(input())
for i in range(0, t):
	lis = list(map(int, input().split()))
	sum = 0
	val = lis[3] // lis[2]
	if lis[0] > val:
		sum = sum + val * lis[2]
		d = lis[3] - sum
	else:
		sum = sum + lis[0] * lis[2]
		d = lis[3] - sum
	if lis[1] >= d:
		print('YES')
	else:
		print('NO')


import sys
import math
Q = input()
for q in range(0, int(Q)):
	(a, b, n, s) = input().strip().split()
	a = int(a)
	b = int(b)
	n = int(n)
	s = int(s)
	if math.floor(s / n) <= a and s % n <= b:
		print('YES')
	elif math.floor(s / n) <= a and s % n > b:
		print('NO')
	elif math.floor(s / n) > a and s - n * a - b <= 0:
		print('YES')
	else:
		print('NO')


q = int(input())
answers = []
for i in range(q):
	s = input()
	ints = list(map(int, s.split()))
	(a, b, n, S) = (ints[0], ints[1], ints[2], ints[3])
	x = S // n
	S -= min(x, a) * n
	if S <= b:
		answers.append('YES')
	else:
		answers.append('NO')
for a in answers:
	print(a)


q = int(input())
for i in range(q):
	l = list(map(int, input().split()))
	(a, b, n, s) = (l[0], l[1], l[2], l[3])
	d = s // n
	if d >= a:
		if s - a * n <= b:
			print('YES')
		else:
			print('NO')
	elif b >= s - d * n:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	t -= 1
	q = list(map(int, input().split()))
	a = q[0]
	b = q[1]
	n = q[2]
	s = q[3]
	if b + a * n < s:
		print('NO')
	elif s // n <= a:
		if s % n == 0:
			print('YES')
		else:
			s = s % n
			if b >= s:
				print('YES')
			else:
				print('NO')
	elif s // n > a:
		s = s % n
		if b >= s:
			print('YES')
		else:
			print('NO')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(a, b, n, S) = map(int, input().split())
	print('YES' if n * a + b >= S and S % n <= b else 'NO')


def program():
	l = list(map(int, input().split()))
	a = int(l[0])
	b = int(l[1])
	n = int(l[2])
	s = int(l[3])
	if s > a * n + b:
		print('NO')
		return 0
	if a * n > s:
		a = s // n
	if a * n + b >= s:
		print('YES')
	else:
		print('NO')
t = int(input())
for i in range(t):
	program()


for io in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	maxcoin = s // n
	x = min(maxcoin, a)
	if n * x + b >= s:
		print('YES')
	else:
		print('NO')


from math import ceil, log, floor, sqrt
import math
k = 1

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def is_prime(n):
	m = 2
	while m * m <= n:
		if n % m == 0:
			return False
		m += 1
	return True

def find_sum(n, a):
	a.insert(0, 0)
	for i in range(1, n + 1):
		prev = a[i] & a[i - 1]
		cur = a[i] | a[i - 1]
		a[i - 1] = prev
		a[i] = cur
	return sum((m * m for m in a))

def prin_abc(x, y, z):
	l = [x, y, z]
	l.sort()
	if l[1] < l[2]:
		print('NO')
		return
	a = b = l[0]
	c = l[2]
	print('YES')
	print(a, b, c)

def get_scores(n, vals):
	l = 0
	r = n - 1
	turn = 0
	sereja = 0
	dima = 0
	while l <= r:
		if vals[l] > vals[r]:
			cur = vals[l]
			l += 1
		else:
			cur = vals[r]
			r -= 1
		if turn == 0:
			sereja += cur
		else:
			dima += cur
		turn = not turn
	print(sereja, dima)

def count_lamps(n, m):
	return (n * m + 1) // 2

def count_moves(n, name):
	mvs = 0
	cnt = 0
	for i in range(n):
		if name[i] == 'x':
			cnt += 1
		else:
			mvs += max(0, cnt - 2)
			cnt = 0
	mvs += max(0, cnt - 2)
	return mvs

def has_chan(a, b, n, S):
	x = min(a, S // n)
	return b >= S - x * n
t = 1
t = int(input())
while t:
	t = t - 1
	points = []
	(a, b, n, S) = map(int, input().split())
	if has_chan(a, b, n, S):
		print('YES')
	else:
		print('NO')


q = int(input())
out = [False] * q
for i in range(q):
	(bigs, smalls, n, S) = map(int, input().split())
	if smalls < S % n:
		continue
	result = S % n
	smalls -= S % n
	result += n * (smalls // n)
	result += n * bigs
	out[i] = result >= S
for i in out:
	if i:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	m = s // n
	if m >= a:
		v = n * a + b
	else:
		v = m * n + b
	if v >= s:
		print('YES')
	else:
		print('NO')


def solve(a, b, n, s):
	if min(s // n, a) * n + b < s:
		return 'NO'
	return 'YES'
q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	print(solve(a, b, n, s))


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	if a * c <= d and d - a * c <= b:
		print('YES')
	elif a * c >= d and d % c <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for oo in range(t):
	(coinsOfValueN, coinsOfValue1, N, total) = [int(_) for _ in input().split()]
	if total < N:
		if total > coinsOfValue1:
			print('NO')
		else:
			print('YES')
	else:
		n = total // N
		remain = total % N
		if n <= coinsOfValueN:
			if remain <= coinsOfValue1:
				print('YES')
				continue
			else:
				print('NO')
				continue
		elif n > coinsOfValueN:
			if total - coinsOfValueN * N <= coinsOfValue1:
				print('YES')
				continue
			else:
				print('NO')


import sys, math, statistics as ss, collections as cc
input = sys.stdin.readline
t = int(input())
for i in range(t):
	(a, b, n, s) = map(int, input().split())
	if s - s // n * n <= b and s <= a * n + b:
		print('YES')
	else:
		print('NO')


q = int(input())
for queries in range(q):
	(a, b, n, s) = map(int, input().split())
	if a * n > s:
		soma = s // n * n
	else:
		soma = a * n
	if soma <= s:
		if soma + b >= s:
			print('YES')
		else:
			print('NO')


n = int(input())
for i in range(n):
	ok = False
	(a, b, n, s) = list(map(int, input().split()))
	r = s // n
	s -= n * min(a, r)
	if s > b:
		print('NO')
	else:
		print('YES')


(_y, _n) = ('YES', 'NO')
q = int(input())
for i in range(q):
	(a, b, n, S) = map(int, input().split())
	if a * n + b < S:
		print(_n)
		continue
	left = S % n
	if left:
		if left > b:
			print(_n)
			continue
	print(_y)


n = int(input())
for i in range(n):
	entrada = input().split(' ')
	if int(entrada[3]) // int(entrada[2]) > int(entrada[0]):
		valor = int(entrada[0]) * int(entrada[2])
	else:
		valor = int(entrada[3]) // int(entrada[2]) * int(entrada[2])
	if int(entrada[3]) - valor <= int(entrada[1]):
		print('YES')
	else:
		print('NO')


t = int(input())
for tt in range(t):
	(a, b, n, s) = map(int, input().split())
	temp = s // n
	aa = min(temp, a)
	s -= n * aa
	if b >= s:
		print('YES')
	else:
		print('NO')


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : list(map(int, input().split()))
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
for _ in range(ii()):
	(a, b, n, S) = f()
	x = S // n
	rem = S % n
	if a >= x and b >= S - n * x:
		print('YES')
	elif a < x and b >= (x - a) * n + rem:
		print('YES')
	else:
		print('NO')


q = int(input())
while q:
	q -= 1
	(a, b, n, s) = map(int, input().split())
	aa = min(s // n, a)
	bb = s - aa * n
	if bb <= b:
		print('YES')
	else:
		print('NO')


def do():
	N = int(input())
	for _ in range(N):
		L = input()
		L = [int(i) for i in L.split()]
		(a, b, n, S) = (L[0], L[1], L[2], L[3])
		if n > S:
			if b >= S:
				print('YES')
			else:
				print('NO')
			continue
		if a * n == S:
			print('YES')
			continue
		if a * n > S:
			k = S % n
			if b >= k:
				print('YES')
			else:
				print('NO')
			continue
		if n * a + b >= S:
			print('YES')
		else:
			print('NO')
do()


def check(a, b, n, s):
	if b >= s:
		return 'YES'
	total = min(s // n, a) * n
	if s - total <= b:
		return 'YES'
	else:
		return 'NO'
tc = int(input())
for i in range(tc):
	(a, b, n, s) = [int(x) for x in input().split()]
	print(check(a, b, n, s))


for i in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	flag = 0
	if s % n <= b and s <= a * n + b:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(a, b, n, s) = map(int, input().split())
	f = 0
	if s % n == 0:
		if n * a >= s or s - n * a <= b:
			f = 1
	else:
		k = s // n
		c = min(a, k)
		x = s - c * n
		if x <= b:
			f = 1
		else:
			f = 0
	if f == 1:
		print('YES')
	else:
		print('NO')


cc = int(input())
while cc > 0:
	cc -= 1
	(a, b, n, s) = map(int, input().split())
	x = int(s / n)
	s = s % n
	if x > a:
		s += (x - a) * n
	if s > b:
		print('NO')
	else:
		print('YES')


import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
t = 1
t = int(input())
for _ in range(t):
	(a, b, n, s) = map(int, stdin.readline().split())
	if s <= b:
		print('YES')
	elif s % n == 0 and s // n <= a:
		print('YES')
	elif s > b + a * n:
		print('NO')
	else:
		k = s // n
		s = s % n
		if k > a:
			if a * n + b >= s:
				print('YES')
			else:
				print('NO')
		elif s > b:
			print('NO')
		else:
			print('YES')


q = int(input())
for z in range(q):
	(a, b, n, s) = map(int, input().split())
	c = min(s // n, a)
	s -= c * n
	if s <= b:
		print('YES')
		continue
	print('NO')


from math import ceil
for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if n <= s:
		x = s // n
		y = s - min(x * n, a * n)
		if y <= b:
			print('YES')
		else:
			print('NO')
	elif s <= b:
		print('YES')
	else:
		print('NO')


import sys
I = sys.stdin.readline
ans = ''
for _ in range(int(I())):
	(a, b, n, s) = map(int, I().split())
	if b >= s - min(a, s // n) * n:
		ans += 'YES\n'
	else:
		ans += 'NO\n'
print(ans)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve(case):
	(a, b, n, s) = sep()
	if a * n + b >= s:
		if a * n > s:
			if b >= s % n:
				print('YES')
			else:
				print('NO')
			return
		print('YES')
	else:
		print('NO')
testcase(int(inp()))


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if b >= 2 * n - 1:
		p = (b - n + 1) // n
		b = b - p * n
		a += p
	t = s // n
	s -= min(a, t) * n
	if b >= s:
		print('YES')
	else:
		print('NO')


q = int(input())
while q:
	(a, b, n, S) = map(int, input().split())
	if a * n + b >= S:
		c = min(a, S // n)
		S -= c * n
		if S <= b:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	q -= 1


for _ in range(int(input())):
	(a, b, n, s) = [int(i) for i in input().strip().split()]
	n1 = min(s // n, a)
	n2 = min(b, s - n1 * n)
	if n1 * n + n2 == s:
		print('YES')
	else:
		print('NO')


q = int(input())
o = [0] * q
for i in range(q):
	(a, b, n, S) = input().split(' ')
	a = int(a)
	b = int(b)
	n = int(n)
	S = int(S)
	if n == S:
		rem = 0
	elif n > S:
		rem = S
	elif a * n > S:
		rem = S % n
	else:
		rem = S - a * n
	if rem <= b:
		o[i] = 'YES'
	else:
		o[i] = 'NO'
for el in o:
	print(el)


a = int(input())
for i in range(a):
	(p, q, r, s) = map(int, input().split())
	if p * r + q < s:
		print('NO')
		continue
	t = s % r
	if t > q:
		print('NO')
	else:
		print('YES')


n = int(input(''))
for t in range(0, n):
	(a, b, n, s) = list(map(int, input().split()))
	num1 = s // n
	if num1 > a and a * n + b < s or s - num1 * n > b:
		print('NO')
	else:
		print('YES')


def nani(a, b, n, s):
	if a * n + b < s:
		return 'NO'
	elif b > n:
		return 'YES'
	else:
		c = s // n
		if b < s - c * n:
			return 'NO'
		else:
			return 'YES'
q = int(input())
output = ['' for i in range(q)]
for j in range(0, q):
	(a, b, n, s) = [int(i) for i in input().split()]
	output[j] = nani(a, b, n, s)
for i in range(0, q):
	print(output[i])


T = int(input())
for _ in range(0, T):
	(a, b, n, s) = map(int, input().split())
	t = min(s // n, a)
	s = s - t * n
	a = a - t
	if s <= b:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	t1 = s // n
	t2 = s % n
	if a >= t1 and b >= t2:
		print('YES')
	elif a < t1 and b >= (t1 - a) * n + t2:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, S) = [int(i) for i in input().split()]
	if a * n < S:
		S -= a * n
	else:
		S -= S // n * n
	if S > b:
		print('NO')
	else:
		print('YES')


def main():
	for _ in range(int(input())):
		(a, b, n, s) = map(int, input().split())
		print(('YES', 'NO')[b + min(s // n, a) * n < s])
main()


for testcase in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	(result, reminder) = divmod(s, n)
	if result <= a:
		if reminder <= b:
			print('YES')
		else:
			print('NO')
	elif a * n + b >= s:
		print('YES')
	else:
		print('NO')


for q in range(int(input())):
	(a, b, n, S) = (int(i) for i in input().split())
	s = 0
	if a < S // n:
		s = a * n
	else:
		s = S // n * n
	if s + b < S:
		print('NO')
	else:
		print('YES')


import math
n = int(input())
a1 = []
for i in range(n):
	(x, y, a, b) = map(int, input().split())
	if x * a > b:
		b = b - a * int(b / a)
	else:
		b -= x * a
	if b <= y:
		a1.append('YES')
	else:
		a1.append('NO')
for i in range(n):
	print(a1[i])


import math
q = int(input())
for i in range(q):
	ele = list(map(int, input().rstrip().split()))
	a = ele[0]
	b = ele[1]
	n = ele[2]
	s = ele[3]
	if s - a * n <= 0:
		x = int(s / n)
		y = s - x * n
		if y <= b:
			print('YES')
		else:
			print('NO')
	elif s - a * n <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
while q > 0:
	q -= 1
	(a, b, n, S) = map(int, input().split())
	div = int(S / n)
	reminder = S
	if div <= a:
		reminder = reminder - div * n
	else:
		reminder = reminder - a * n
	reminder = reminder - b
	if reminder <= 0:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(a, b, n, S) = map(int, input().split())
	t = S // n
	kq = -1
	if t <= a:
		t1 = S - n * t
		if t1 <= b:
			kq = 1
		else:
			kq = 0
	else:
		t1 = S - a * n
		if t1 <= b:
			kq = 1
		else:
			kq = 0
	if kq == 0:
		print('NO')
	else:
		print('YES')


q = int(input())
i = 0
while i in range(q):
	(a, b, n, s) = map(int, input().split())
	amt = n * a + b
	if amt < s:
		print('NO')
	else:
		aa = s % n
		if aa <= b:
			print('YES')
		else:
			print('NO')
	i += 1


for case in range(int(input())):
	tmp = input().split()
	a = int(tmp[0])
	b = int(tmp[1])
	n = int(tmp[2])
	S = int(tmp[3])
	if S > a * n + b:
		print('NO')
	elif S % n > b:
		print('NO')
	else:
		print('YES')


import math
p = input()
n = int(p)
for i in range(0, n, 1):
	import array
	arr1 = array.array('l', [])
	arr1 = [int(j) for j in input().split()]
	a = arr1[0]
	b = arr1[1]
	n = arr1[2]
	s = arr1[3]
	ss = b + a * n
	if ss < s:
		print('NO')
	elif n * a == s:
		print('YES')
	elif n * a > s:
		aa = int(s % n)
		if b >= aa:
			print('YES')
		else:
			print('NO')
	else:
		cc = s - a * n
		if cc <= b:
			print('YES')
		else:
			print('NO')


import sys
q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, sys.stdin.readline().split())
	op = s // n
	ost = s % n
	if op >= a:
		op = a
		s -= op * n
		if s <= b:
			print('YES')
		else:
			print('NO')
	elif op < a:
		s -= op * n
		if s <= b:
			print('YES')
		else:
			print('NO')


num_case = input()
num = int(num_case)
flage = False
while num != 0:
	flage = False
	(a, b, c, d) = [int(x) for x in input().split()]
	if d % c == 0 and d // c <= a:
		flage = True
	elif d % c == d:
		if b >= d:
			flage = True
	elif d // c <= a:
		remain = d % c
		if remain <= b:
			flage = True
	elif a * c + b >= d:
		flage = True
	if flage == False:
		print('NO')
	else:
		print('YES')
	num -= 1


n = int(input())
for i in range(n):
	(a, b, c, d) = map(int, input().split())
	z = a * c + b
	if z < d:
		print('NO')
	elif z == d:
		print('YES')
	elif d % c <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for r in range(t):
	(a, b, n, S) = map(int, input().split())
	if (S - b) / n > a:
		print('NO')
	else:
		x = (S - b) // n
		flag = 1
		if S - n * x > b and n * (x + 1) > S:
			print('NO')
		else:
			print('YES')


q = int(input())
for case in range(q):
	(a, b, n, S) = map(int, input().split())
	tmp = S // n
	if b >= (S - tmp * n if tmp <= a else S - a * n):
		print('YES')
	else:
		print('NO')


q = int(input())
for _ in range(q):
	L = list(map(int, input().split()))
	(m_n, m1, n, s) = (L[0], L[1], L[2], L[3])
	if m_n * n + m1 >= s and s % n <= m1:
		print('YES')
	else:
		print('NO')


q = int(input())
lis = []
for i in range(q):
	ans = 'YES'
	(a, b, n, s) = map(int, input().split())
	if s % n > b:
		ans = 'NO'
	elif s // n > a and s - n * a > b:
		ans = 'NO'
	lis.append(ans)
for i in range(q):
	print(lis[i])


n = int(input())
for i in range(n):
	flag = list(map(int, input().split()))
	if flag[2] * flag[0] + flag[1] < flag[3]:
		print('NO')
	elif flag[3] % flag[2] <= flag[1]:
		print('YES')
	else:
		print('NO')


T = int(input())
for O in range(T):
	(a, b, n, s) = map(int, input().split(' '))
	c = s % n
	if c <= b and a * n + b >= s:
		print('YES')
	else:
		print('NO')


tests = int(input())
testCases = []
while tests > 0:
	testCases.append(list(map(int, input().split(' '))))
	tests -= 1
for test in testCases:
	if test[3] > test[0] * test[2] + test[1]:
		print('NO')
	elif test[3] > test[0] * test[2]:
		if test[1] >= test[3] - test[0] * test[2]:
			print('YES')
		else:
			print('NO')
	elif test[3] % test[2] <= test[1]:
		print('YES')
	else:
		print('NO')


q = int(input())
for Q in range(q):
	x = input()
	(a, b, n, s) = x.split(' ')
	a = int(a)
	b = int(b)
	n = int(n)
	s = int(s)
	p = s // n
	q = s % n
	if b >= s:
		print('YES')
	elif p <= a:
		if q <= b:
			print('YES')
		else:
			print('NO')
	elif s - a * n <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
x = []
for i in range(q):
	l = list(map(int, input().split()))
	x.append(l)
for i in range(q):
	a = x[i][0]
	b = x[i][1]
	n = x[i][2]
	S = x[i][3]
	s = (S - b) / n
	g = S / n
	t = g // 1
	if g <= a:
		if t >= s:
			print('YES')
		else:
			print('NO')
	elif a >= s:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
q = int(input())
for testcases in range(q):
	(a, b, n, S) = map(int, input().split())
	x = S // n
	S -= min(x, a) * n
	if S <= b:
		print('YES')
	else:
		print('NO')


import re
for _ in range(int(input())):
	(a, b, n, s) = [int(x) for x in input().split()]
	if a * n > s:
		s = s % n
	else:
		s = s - a * n
	if b >= s:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, n, r) = [int(i) for i in input().split()]
	cn = r // n
	if cn > a:
		if a * n + b >= r:
			print('YES')
		else:
			print('NO')
	elif cn * n + b >= r:
		print('YES')
	else:
		print('NO')


def solve():
	(a, b, n, s) = map(int, input().split())
	k = min(a, s // n)
	if s - k * n <= b:
		print('YES')
	else:
		print('NO')

def main():
	q = int(input())
	for _ in range(q):
		solve()
main()


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations

def li():
	return list(map(int, sys.stdin.readline().split()))

def num():
	return map(int, sys.stdin.readline().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg
mm = 1000000007

def solve():
	t = nu()
	for tt in range(t):
		(a, b, n, s) = num()
		x = s // n
		y = s % n
		if x > a:
			op = (x - a) * n
			x = a
			y += op
		if y <= b:
			print('YES')
		else:
			print('NO')
solve()


import sys
Input = sys.stdin.readline
N = int(Input())
for i in range(N):
	(a, b, n, s) = map(int, Input().split())
	tmp = min(a, s // n)
	re = s - tmp * n
	if re > b:
		print('NO')
	else:
		print('YES')


q = int(input())
for i in range(q):
	(a, b, n, S) = [int(x) for x in input().split()]
	mostn = S // n
	nused = min(mostn, a)
	S -= nused * n
	if b >= S:
		print('YES')
	else:
		print('NO')


e = int(input())
while e > 0:
	e = e - 1
	l = [int(x) for x in input().split()]
	a = l[0]
	b = l[1]
	n = l[2]
	s = l[3]
	if a * n + b < s or s % n > b:
		print('NO')
	else:
		print('YES')


q = int(input())
for query in range(q):
	(a, b, n, S) = map(int, input().split())
	maxBig = S // n
	S = S - n * min(a, maxBig)
	if S <= b:
		print('YES')
	else:
		print('NO')


from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return [x for x in mi()]

def si():
	return stdin.readline()
for _ in range(ii()):
	(a, b, n, s) = mi()
	a = min(a, s // n) * n
	print('YES' if b >= s - a else 'NO')


n1 = int(input())
for i in range(n1):
	l = [int(c) for c in input().split()]
	(a, b, n, S) = l
	if a * n + b < S:
		print('NO')
	elif S % n > b:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	(a, b, n, S) = [int(x) for x in input().split()]
	m = min(int(S / n) * n, a * n)
	req = S - m
	if b >= req:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	left = (s // n - a + n - 1) // n
	right = (b - s % n) // n
	if s % n <= b and a * n + b >= s:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(a, b, n, s) = [int(s) for s in input().split(' ')]
	if s - b > a * n:
		print('NO')
		continue
	rem = s % n
	if b >= rem:
		print('YES')
		continue
	else:
		print('NO')


q = int(input())
result = []
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	c = s // n
	if s - min(c, a) * n <= b:
		result.append('YES')
	else:
		result.append('NO')
print('\n'.join(result))


q = int(input())
for qq in range(0, q):
	(a, b, n, S) = [int(x) for x in input().split()]
	S = S - n * min(S // n, a)
	if S == 0:
		print('YES')
	else:
		S = S - min(S, b)
		if S == 0:
			print('YES')
		else:
			print('NO')


for x in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	t = s % n
	d = s // n
	if b == s:
		print('YES')
	elif t <= b and d <= a:
		print('YES')
	elif d > a and t <= b:
		if a * n + b >= s:
			print('YES')
		else:
			print('NO')
	elif d <= a and t > b:
		if b + d * n >= s:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(a, b, n, S) = map(int, input().split())
	f = min(S // n, a)
	S -= f * n
	if S <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(a, b, n, s) = map(int, input().split())
	if s <= b:
		print('YES')
		continue
	elif s < n:
		print('NO')
	elif s // n <= a:
		if s % n <= b:
			print('YES')
		else:
			print('NO')
	elif s - a * n <= b:
		print('YES')
	else:
		print('NO')


def solve(a, b, n, S):
	x = min(S // n, a)
	y = S - x * n
	return y <= b
for _ in range(int(input())):
	(a, b, n, S) = [int(c) for c in input().split()]
	if solve(a, b, n, S):
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, n, s) = [int(j) for j in input().split()]
	k = s // n
	if k > a:
		s -= n * a
		if s > b:
			print('NO')
		else:
			print('YES')
	else:
		s -= k * n
		if s > b:
			print('NO')
		else:
			print('YES')


cases = int(input())
lines = ''
for i in range(cases):
	lines += input() + '\n'
lines = lines.splitlines()
for case in range(cases):
	vals = lines[case].split()
	(a, b, n, s) = [int(val) for val in vals]
	d = s // n
	if d > a and a * n + b >= s:
		print('YES')
	elif d <= a and d * n + b >= s:
		print('YES')
	else:
		print('NO')


def mai(a):
	for i in range(a):
		(a, b, n, s) = map(int, input().split())
		if s % n <= b and a * n + b >= s:
			print('YES')
		else:
			print('NO')
mai(int(input()))


q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	m = min(a, s // n)
	if s - m * n > b:
		print('NO')
	else:
		print('YES')


def f(a, b, n, S):
	if S > a * n + b:
		return 'NO'
	elif n == b:
		return 'YES'
	elif n > b:
		if S % n < b + 1:
			return 'YES'
		return 'NO'
	else:
		return 'YES'
t = int(input())
for i in range(0, t):
	(a, b, n, S) = map(int, input().split())
	print(f(a, b, n, S))


def solve(a, b, n, S):
	return ['NO', 'YES'][min(S // n, a) * n + b >= S]
for q in range(int(input())):
	(a, b, n, S) = map(int, input().split())
	print(solve(a, b, n, S))


for _ in range(int(input())):
	(a, b, n, s) = list(map(int, input().split()))
	if a * n == s:
		print('YES')
	elif a * n > s:
		val = s % n
		if val <= b:
			print('YES')
		else:
			print('NO')
	elif a * n < s:
		if s - a * n <= b:
			print('YES')
		else:
			print('NO')


import sys
import itertools
import math
import collections
from collections import Counter

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = prime[1] = False
	r = [p for p in range(n + 1) if prime[p]]
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)
t = ii()
for _ in range(t):
	(a, b, n, s) = mi()
	s = s - min(s // n, a) * n
	if s <= b:
		print('YES')
	else:
		print('NO')


def main():
	q = int(input())
	prob = []
	for i in range(q):
		prob.append([int(number) for number in input().split()])
	for ligne in prob:
		y = ligne[3] // ligne[2]
		if y >= ligne[0]:
			if ligne[2] * ligne[0] + ligne[1] >= ligne[3]:
				print('YES')
			else:
				print('NO')
		elif ligne[2] * y + ligne[1] >= ligne[3]:
			print('YES')
		else:
			print('NO')
main()


def testAnswer():
	test_cases_count = int(input())
	for i in range(test_cases_count):
		(a, b, n, S) = map(int, input().strip().split())
		if S % n > b:
			print('NO')
			continue
		if a * n + b >= S:
			print('YES')
			continue
		print('NO')
testAnswer()


n = int(input())
res = []
for i in range(n):
	res += [input().split()]
for i in range(n):
	k = []
	(a, b, n, S) = (int(res[i][0]), int(res[i][1]), int(res[i][2]), int(res[i][3]))
	if S > a * n + b:
		print('NO')
	elif a * n <= S <= a * n + b:
		print('YES')
	elif S % n <= b:
		print('YES')
	else:
		print('NO')


from math import floor
q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	na = floor(s / n) * n
	if na > a * n:
		na = a * n
	if na + b >= s:
		print('YES')
	else:
		print('NO')


for _ in [0] * int(input()):
	(a, b, n, s) = map(int, input().split())
	print('YNEOS'[min(s // n, a) * n + b < s::2])


from sys import stdin
from math import floor
n = int(input())

def solve(a, b, c, d):
	if d % c <= b and floor(d / c) <= a:
		return 'YES'
	if a * c < d and a * c + b >= d:
		return 'YES'
	return 'NO'
while n > 0:
	(a, b, c, d) = map(int, stdin.readline().rstrip().split())
	print(solve(a, b, c, d))
	n = n - 1


x = input()
for i in range(int(x)):
	s = input()
	l = s.split()
	n_coin_val = int(l[0])
	val = int(l[2])
	n_coin_1 = int(l[1])
	sum = int(l[3])
	r = 0
	a = int(sum / val)
	if a <= n_coin_val:
		r = sum - a * val
	else:
		r = sum - n_coin_val * val
	if r <= n_coin_1:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for _ in range(t):
	(a, b, n, S) = map(int, input().split())
	if a * n + b < S:
		print('NO')
	elif a * n + b > S:
		if S % n == 0:
			print('YES')
		elif b >= S % n:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')


def solve():
	(a, b, n, s) = map(int, input().split())
	ra = s // n
	if ra <= a:
		rb = s % n
		if rb <= b:
			print('YES')
		else:
			print('NO')
	else:
		s -= n * a
		rb = s
		if rb <= b:
			print('YES')
		else:
			print('NO')
t = int(input())
for _ in range(t):
	solve()


n = int(input())
for nn in range(n):
	val = [int(x) for x in input().split(' ')]
	a = val[0]
	b = val[1]
	n = val[2]
	S = val[3]
	if a * n + b < S:
		print('NO')
		continue
	remainder = S % n
	if b < remainder:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(a, b, n, s) = [int(i) for i in input().split()]
	x = s // n
	nm = min(x, a)
	if nm * n + b >= s:
		print('YES')
	else:
		print('NO')


a = int(input())
for x in range(a):
	b = list(map(int, input().split(' ')))
	adam = b[3] // b[2]
	if adam > b[0]:
		adam = b[0]
	hassan = adam * b[2]
	if b[3] - hassan <= b[1]:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, n, S) = list(map(int, input().split()))
	if a * n + b < S:
		print('NO')
	else:
		x = S % n
		print('YES' if x <= b else 'NO')


import math
q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	x = math.floor(s / n)
	y = s % n
	if y <= b:
		if x <= a:
			print('YES')
		elif x > a and a * n + b >= s:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


q = int(input())
for i in range(q):
	list1 = list(map(int, input().split()))
	a = list1[0]
	b = list1[1]
	n = list1[2]
	S = list1[3]
	if a * n < S:
		S = S - a * n
		if b >= S:
			print('YES')
		else:
			print('NO')
	else:
		A = S // n
		B = S - A * n
		if A <= a and B <= b:
			print('YES')
		else:
			print('NO')


querys = int(input())
for i in range(querys):
	(a, b, n, s) = map(int, input().split())
	ans = False
	if s // n <= a:
		if s // n * n + b >= s:
			ans = True
	elif n * a + b >= s:
		ans = True
	if ans:
		print('YES')
	else:
		print('NO')


import math
test_cases = int(input())

def testCase():
	(a, b, n, S) = [int(x) for x in input().strip().split()]
	S -= min(int(math.floor(S / n)), a) * n
	S -= min(S, b)
	print('YES' if S == 0 else 'NO')
for t in range(test_cases):
	testCase()


import math
q = int(input())

def change():
	(a, b, n, S) = (int(j) for j in input().split())
	x = min(a, S // n)
	if S % n <= b and a * n + b >= S:
		print('YES')
	else:
		print('NO')
while q > 0:
	change()
	q -= 1


import math
import sys
from collections import defaultdict
from itertools import groupby
rt = lambda : map(int, input().split())
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))

def main():
	t = ri()
	for _ in range(t):
		(a, b, n, S) = rt()
		print('YES' if S - min(a * n, S // n * n) <= b else 'NO')
main()


from collections import *
import sys

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))
t = ri()
for _ in range(t):
	ans = 'NO'
	(a, b, n, S) = rl()
	if S <= b:
		ans = 'YES'
	else:
		q = int(S / n)
		if q >= (S - b) / n and a >= (S - b) / n:
			ans = 'YES'
	print(ans)


q = int(input())
while q:
	(a, b, n, s) = map(int, input().split())
	m = s // n
	if m <= a:
		if s - m * n > b:
			print('NO')
		else:
			print('YES')
	elif s - a * n > b:
		print('NO')
	else:
		print('YES')
	q -= 1


testcases = int(input())
while testcases > 0:
	testcases = testcases - 1
	(a, b, n, S) = map(int, input().split())
	if a * n + b < S:
		print('NO')
	else:
		num = S // n
		num = min(num, a)
		if num * n + b >= S:
			print('YES')
		else:
			print('NO')


t = int(input())
for _ in range(t):
	(a, n, b, S) = [int(x) for x in input().split(' ')]
	ost = S // b
	if ost <= a:
		if S <= ost * b + n:
			print('YES')
		else:
			print('NO')
	elif S <= b * a + n:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if s % n <= b:
		if a * n + b >= s:
			print('YES')
			continue
	print('NO')


q = int(input())
for i in range(q):
	inp = list(map(int, input().split()))
	[a, b, n, s] = inp
	mx = s // n
	x = min(a, mx)
	y = s - n * x
	if y <= b:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
from collections import defaultdict
import heapq
import math

def get_int():
	return int(stdin.readline().strip())

def get_ints():
	return map(int, stdin.readline().strip().split())

def get_array():
	return list(map(int, stdin.readline().strip().split()))

def get_string():
	return stdin.readline().strip()
INF = 10000000000.0
mod = 1000000000.0 + 7
for _ in range(int(stdin.readline())):
	(a, b, n, s) = get_ints()
	if a * n < s:
		if a * n + b >= s:
			print('YES')
			continue
	else:
		c = s // n
		if c * n + b >= s:
			print('YES')
			continue
	print('NO')


import sys
input = sys.stdin.readline
y = int(input())
for i in range(y):
	(a, b, n, S) = map(int, input().split())
	y1 = int(S / n)
	if a <= y1:
		S = S - a * n
	else:
		S = S - y1 * n
	if S <= b:
		print('YES')
	else:
		print('NO')


def solve(a, b, n, S):
	print('YES' if S <= a * n + b and S % n <= b else 'NO')

def main():
	N = int(input())
	for _ in range(N):
		(a, b, n, S) = map(int, input().split())
		solve(a, b, n, S)
main()


q = int(input())
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	z = min(a, S // n)
	S -= z * n
	print('YES' if b >= S else 'NO')


from sys import stdin, stdout
q = int(stdin.readline())
for i in range(q):
	(a, b, n, s) = stdin.readline().split()
	(a, b, n, s) = (int(a), int(b), int(n), int(s))
	if s // n <= a:
		if s % n <= b:
			stdout.write('YES')
			stdout.write('\n')
		else:
			stdout.write('NO')
			stdout.write('\n')
	elif s - a * n <= b:
		stdout.write('YES')
		stdout.write('\n')
	else:
		stdout.write('NO')
		stdout.write('\n')


t = int(input())
for i in range(t):
	(a, b, n, s) = [int(x) for x in input().split()]
	tot = 0
	if int(s / n) < a:
		tot = n * int(s / n)
	else:
		tot = n * a
	if s - tot <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	t -= 1
	(a, b, n, s) = map(int, input().split(' '))
	c = 0
	res = False
	d = s % n
	if d <= b and a * n + b >= s:
		res = True
	if res:
		print('YES')
	else:
		print('NO')


t = int(input())
for case_num in range(t):
	(a, b, n, s) = map(int, input().split(' '))
	if b > n:
		a += (b - n) // n
		b = b % n + n
	na = s // n
	nb = s % n
	print('YES' if a >= na and b >= nb or (a == na - 1 and b >= nb + n) else 'NO')


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter

def pow(a, b):
	if b == 0:
		return 1
	else:
		val = pow(a, int(b / 2))
		if b % 2 == 0:
			return val * val
		elif b > 0:
			return a * val * val
		else:
			return val * val // a
t = int(input())
for i in range(t):
	l = input().split()
	a = int(l[2])
	b = int(l[1])
	n = int(l[0])
	s = int(l[3])
	val = s // a
	if val > n:
		v = s - a * n
		if v > b:
			print('NO')
		else:
			print('YES')
	else:
		v = s - a * val
		if v > b:
			print('NO')
		else:
			print('YES')


for _ in range(int(input())):
	(a, b, n, S) = map(int, input().split())
	(p, q) = divmod(S, n)
	if p > a:
		S -= a * n
	else:
		S -= p * n
	if b >= S:
		print('YES')
	else:
		print('NO')


for q in range(int(input())):
	(a, b, n, s) = [int(i) for i in input().split()]
	aa = min(a, s // n)
	dif = s - aa * n
	print(['NO', 'YES'][dif <= b])


q = int(input())
a = b = n = s = m = o = 0
for c in range(q):
	(a, b, n, s) = map(int, input().split())
	m = s // n
	if m <= a:
		o = s - m * n
	else:
		o = s - a * n
	if o <= b:
		print('YES')
	else:
		print('NO')


for kk in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	k = s // n
	if k <= a:
		left = s - k * n
		if left <= b:
			print('YES')
		else:
			print('NO')
	else:
		left = s - a * n
		if left <= b:
			print('YES')
		else:
			print('NO')


n = int(input())
for i in range(n):
	(a, b, n, s) = list(map(int, input().split()))
	nextS = s % n
	if nextS > b:
		print('NO')
		continue
	nextS += max(s // n - a, 0) * n
	if nextS > b:
		print('NO')
	else:
		print('YES')


import math
test = int(input())
for tes in range(test):
	(a, b, n, s) = list(map(int, input().split()))
	mul = s // n
	diff = s - mul * n
	have = n * min(a, mul)
	if s - have <= b:
		print('YES')
	else:
		print('NO')


n = int(input())
for j in range(n):
	ls = [int(i) for i in input().split()]
	if ls[0] * ls[2] + ls[1] < ls[3]:
		print('NO')
	else:
		p = ls[3] % ls[2]
		if p <= ls[1]:
			print('YES')
		else:
			print('NO')


t = int(input())
while t > 0:
	t -= 1
	(a, b, n, S) = map(int, input().split())
	val = min(a, S // n)
	val1 = S - val * n
	if b >= val1:
		print('YES')
	else:
		print('NO')


q = int(input())
for _ in ' ' * q:
	(a, b, n, s) = map(int, input().split())
	if a * n + b < s:
		print('NO')
		continue
	else:
		p = s // n
		if p > a:
			p = a
		if b + p * n >= s:
			print('YES')
		else:
			print('NO')


b = int(input())
for k in range(b):
	a = list(map(int, input().split()))
	c = a[3] // a[2]
	if c <= a[0] and a[1] >= a[3] % a[2] or (c > a[0] and a[3] <= a[1] + a[0] * a[2]):
		print('YES')
	else:
		print('NO')


def solve():
	(a, b, n, s) = map(int, input().strip().split())
	maxi = a * n + b
	if s <= maxi:
		kit = s % n
		if kit <= b:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')

def main():
	for _ in range(int(input())):
		solve()
main()


import os
import sys
from io import BytesIO, IOBase
import math
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	k = s // n
	if k < a:
		s = s - k * n
	else:
		s = s - a * n
	if s <= b:
		print('YES')
	else:
		print('NO')


def yesorno(a):
	if a[3] % a[2] <= a[1] and a[0] * a[2] + a[1] >= a[3]:
		return True
	return False
q = int(input())
while q:
	a = [int(a) for a in input().split()]
	flag = yesorno(a)
	if flag:
		print('YES')
	else:
		print('NO')
	q -= 1


q = int(input())
while q:
	(a, b, n, S) = map(int, input().split())
	if S % n == 0:
		x = S // n
		if a >= x:
			print('YES')
		elif n * a + b >= S:
			print('YES')
		else:
			print('NO')
	elif b >= S:
		print('YES')
	elif a * n < S:
		if a * n + b >= S:
			print('YES')
		else:
			print('NO')
	elif a * n > S:
		x = S // n
		if x * n + b >= S:
			print('YES')
		else:
			print('NO')
	q -= 1


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(l()[0]):
	(a, b, n, s) = l()
	x = min(a, s // n)
	y = s - x * n
	if y <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	s = input().split(' ')
	need = min(int(s[3]) // int(s[2]), int(s[0]))
	if int(s[1]) >= int(s[3]) - need * int(s[2]):
		print('YES')
	else:
		print('NO')


import statistics
import math
import datetime
import collections
__author__ = 'Zumrat Kochshegulov'
__contact__ = 'topcoderkz[at]gmail.com'

def main():
	n = int(input())
	for _ in range(n):
		(a, b, n, S) = input().split()
		(a, b, n, S) = (int(a), int(b), int(n), int(S))
		(l, r) = (0, a)
		while r - l > 1:
			mid = (l + r) // 2
			if n * mid >= S:
				r = mid
			else:
				l = mid
		if n * l <= S and n * l + b >= S:
			print('YES')
		elif n * r <= S and n * r + b >= S:
			print('YES')
		else:
			print('NO')
main()


t = int(input())
for i in range(t):
	(a, b, n, S) = [int(i) for i in input().split()]
	remainder = S % n
	if a * n + b >= S and remainder <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for case in range(t):
	(a, b, n, S) = [int(x) for x in input().split(' ')]
	if n * a + b >= S and b >= S % n:
		ans = 'YES'
	else:
		ans = 'NO'
	print(ans)


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	print(['YES', 'NO'][a * n + b < s or s % n > b])


q = int(input())
A = []
for i in range(q):
	(a, b, n, S) = map(int, input().split())
	if a * n + b < S:
		A.append('NO')
	elif S % n > b:
		A.append('NO')
	else:
		A.append('YES')
for i in A:
	print(i)


def solve(a, b, n, S):
	x = n * min(S // n, a)
	y = min(S - x, b)
	return x + y == S

def main():
	for _ in range(int(input())):
		(a, b, n, S) = list(map(int, input().split()))
		print('YES' if solve(a, b, n, S) else 'NO')
main()


def check(a, b, n, s):
	if s // n <= a:
		if s // n * n + b >= s:
			return 1
		else:
			return 0
	elif a * n + b >= s:
		return 1
	else:
		return 0
q = int(input())
for i in range(q):
	(a, b, n, s) = list(map(int, input().split()))
	if check(a, b, n, s):
		print('YES')
	else:
		print('NO')


T = int(input())
solution = 0
for t in range(T):
	(a, b, n, s) = map(int, input().split())
	x = s // n
	if x > a:
		rem = s % n + (x - a) * n
	else:
		rem = s % n
	if rem <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
z = []
for zz in range(t):
	(a, b, n, s) = [int(i) for i in input().split()]
	if s % n <= b and s <= a * n + b:
		z.append('YES')
	else:
		z.append('NO')
for i in z:
	print(i)


q = int(input())
for j in range(q):
	(a, b, n, s) = map(int, input().split())
	if b < n:
		if s % n <= b:
			m = (s - s % n) // n
			if m >= 0 and m <= a:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
	else:
		if b >= s:
			m = s
		elif s % n <= b % n:
			m = b - b % n + s % n
		else:
			m = b - b % n + s % n - n
		p = (s - m) // n
		if p >= 0 and p <= a:
			print('YES')
		else:
			print('NO')


testes = int(input())
for t in range(testes):
	ent = input().split(' ')
	a = int(ent[0])
	b = int(ent[1])
	n = int(ent[2])
	s = int(ent[3])
	num = s // n
	if num > a:
		num = a * n
	else:
		num = num * n
	if s - num <= b:
		print('YES')
	else:
		print('NO')


import sys, itertools
tc = int(sys.stdin.readline())
for _ in range(tc):
	(a, b, n, s) = map(int, sys.stdin.readline().split())
	can = False
	s -= n * min(s // n, a)
	if s <= b:
		print('YES')
	else:
		print('NO')


for nt in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if a * n + b >= s and s % n <= b:
		print('YES')
	else:
		print('NO')


from __future__ import print_function
q = int(input())
while q > 0:
	q -= 1
	lst = input()
	arr = list(map(int, lst.split()))
	s = arr[3]
	if arr[0] * arr[2] > s:
		if s % arr[2] <= arr[1]:
			print('YES')
		else:
			print('NO')
	elif arr[0] * arr[2] + arr[1] < s:
		print('NO')
	else:
		print('YES')


q = int(input())
for w in range(q):
	(a, b, n, S) = [int(i) for i in input().split()]
	v = a * n + b
	if v < S:
		print('NO')
		continue
	elif S % n <= b:
		print('YES')
	else:
		print('NO')


import sys

def readline():
	return input()

def fun(a, b, n, total):
	x = int(total / n)
	x = min(x, a)
	x = x * n
	return 'YES' if x + b >= total else 'NO'
q = int(readline())
for i in range(q):
	p = list(map(int, readline().split(' ')))
	ans = fun(p[0], p[1], p[2], p[3])
	print(ans)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if a * n + b >= s and s % n <= b:
		print('YES')
	else:
		print('NO')


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
for _ in range(get_int()):
	(a, b, n, s) = get_int_list()
	m = min(s // n, a)
	s -= m * n
	if s <= b:
		print('YES')
	else:
		print('NO')


import sys
sin = sys.stdin
q = int(sin.readline())
for _ in range(q):
	abns = [int(x) for x in sin.readline().split()]
	a = abns[0]
	b = abns[1]
	n = abns[2]
	s = abns[3]
	if a * n + b < s:
		print('NO')
	elif s % n > b:
		print('NO')
	else:
		print('YES')


q = int(input())
result = []
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	if a * n + b < S:
		result.append('NO')
	elif S - min(S // n, a) * n <= b:
		result.append('YES')
	else:
		result.append('NO')
for i in range(q):
	print(result[i])


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for i in range(t):
		(a, b, n, s) = map(int, input().split())
		cnt = min(a, s // n)
		x = s - cnt * n
		if x == 0:
			print('YES')
			continue
		if x > b:
			print('NO')
		else:
			print('YES')
main()


from sys import stdin
(_, *l) = stdin.read().splitlines()
for (i, s) in enumerate(l):
	(a, b, n, s) = map(int, s.split())
	l[i] = ('YES', 'NO')[b + min(s // n, a) * n < s]
print('\n'.join(l))


import sys
input = sys.stdin.readline
n = int(input())
for i in range(n):
	(a, b, c, s) = map(int, input().split())
	count = min(s // c, a)
	if s - count * c <= b:
		print('YES')
	else:
		print('NO')


n = int(input(''))
mat = []
for i in range(n):
	mat.append(list(map(int, input().split())))
for i in range(n):
	t = mat[i]
	a = t[0]
	b = t[1]
	c = t[2]
	s = t[3]
	if a * c + b < s:
		print('NO')
	else:
		if a * c > s:
			a = int(s / c)
		if a * c + b >= s:
			print('YES')
		else:
			print('NO')


T = int(input())
for i in range(T):
	(a, b, n, S) = map(int, input().strip().split())
	p = S // n
	a = min([p, a])
	if n * a + b >= S:
		print('YES')
	else:
		print('NO')


num = int(input())
for i in range(num):
	(a, b, n, s) = map(int, input().split())
	if n > s:
		if b >= s:
			print('YES')
		else:
			print('NO')
	else:
		need = a * n
		if need > s:
			if s % n <= b:
				print('YES')
			else:
				print('NO')
		elif need + b >= s:
			print('YES')
		else:
			print('NO')


from sys import stdin
import math
n = int(stdin.readline().rstrip())
for _ in range(n):
	(a, b, n, S) = map(int, stdin.readline().rstrip().split(' '))
	if b >= S:
		print('YES')
	elif S <= a * n + b and a * n <= S:
		print('YES')
	else:
		l = 1
		r = a
		while l <= r:
			m = (l + r) // 2
			cur = n * m
			next = n * (m + 1)
			if cur <= S and cur + b >= S:
				print('YES')
				break
			elif cur < S:
				l = m + 1
			else:
				r = m - 1
		if l > r:
			print('NO')


def gcd(a, b):
	if a == 0:
		return b
	else:
		return gcd(b % a, a)
t = int(input())
for u in range(t):
	(a, b, n, s) = map(int, input().split())
	if s % n > b:
		print('NO')
		continue
	b -= s % n
	if b + s % n + a * n >= s:
		print('YES')
		continue
	print('NO')


nbq = int(input())
for _ in range(nbq):
	(a, b, n, s) = [int(x) for x in input().split()]
	maxa = min(s // n, a)
	balance = s - maxa * n
	print(['NO', 'YES'][balance <= b])


x = int(input())
for i in range(x):
	p = list(map(int, input().split()))
	a = p[0] * p[2]
	if a <= p[3]:
		a = p[3] - a
		if a <= p[1]:
			print('YES')
		else:
			print('NO')
	else:
		b = p[1] + p[3] // p[2] * p[2]
		if b >= p[3]:
			print('YES')
		else:
			print('NO')


from math import ceil, sqrt, gcd
from collections import deque

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
t = ii()
while t:
	t -= 1
	(a, b, n, s) = mi()
	x = s // n
	s1 = 0
	if a >= x:
		s1 = s % n
	else:
		s1 = s - a * n
	if b >= s1:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	counta = s // n
	countb = s % n
	if countb <= b:
		if b + a * n < s:
			print('NO')
		else:
			print('YES')
	else:
		print('NO')


for case in range(int(input())):
	(numOfCoinsA, numOfCoinsB, coinValue, total) = map(int, input().split())
	maxCoinsN = total // coinValue
	if maxCoinsN > numOfCoinsA:
		maxCoinsN = numOfCoinsA
	total -= coinValue * maxCoinsN
	if total <= numOfCoinsB:
		print('YES')
	else:
		print('NO')


import sys

def main():
	for _ in range(int(input())):
		(a, b, n, s) = get_ints()
		if a * n + b < s:
			print('NO')
		else:
			x = s // n * n
			if x + b >= s:
				print('YES')
			else:
				print('NO')
input = lambda : sys.stdin.readline().strip()
get_ints = lambda : map(int, input().split())
get_array = lambda : list(map(int, input().split()))
main()


def solve(a, b, n, s):
	a_count = s // n
	if b >= s:
		print('YES')
	elif s % n == 0 and a >= a_count:
		print('YES')
	elif s <= min(a, a_count) * n + b:
		print('YES')
	else:
		print('NO')
q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	solve(a, b, n, s)


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
q = rint()
for _ in range(q):
	(a, b, n, s) = rints()
	(x, y) = divmod(s, n)
	if x > a:
		y += n * (x - a)
		x = a
	print('YES' if y <= b else 'NO')


for i in range(int(input())):
	(a, b, n, s) = list(map(int, input().split()))
	if n <= s:
		p = s // n
		q = s % n
		if a >= p and b >= q:
			print('YES')
		elif a < p and b >= s - n * a:
			print('YES')
		else:
			print('NO')
	elif b >= s:
		print('YES')
	else:
		print('NO')


b = int(input())
a = []
for i in range(b):
	a.append([int(j) for j in input().split()])
for i in a:
	if i[2] * i[0] >= i[3]:
		if i[3] % i[2] <= i[1]:
			print('YES')
		else:
			print('NO')
	elif i[3] - i[2] * i[0] <= i[1]:
		print('YES')
	else:
		print('NO')


def value(a, b, c, d):
	r = d // c
	val = c * a
	if r <= a:
		val = c * r
	s = d - val - b
	if s > 0:
		return 'NO'
	elif s <= 0:
		return 'YES'
n = int(input())
q = []
w = []
r = []
t = []
for i in range(n):
	(a, b, c, d) = [int(x) for x in input().split()]
	q.append(a)
	w.append(b)
	r.append(c)
	t.append(d)
for i in range(n):
	print(value(q[i], w[i], r[i], t[i]))


is_debug = False
q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	if s % n <= b and a * n + b >= s:
		flag = True
	else:
		flag = False
	print(f"{('YES' if flag else 'NO')}")


q = int(input())
for i in range(q):
	(a, b, n, s) = [int(x) for x in input().split(' ')]
	d = s // n
	b_req = s % n + n * max(0, d - a)
	if b_req <= b:
		print('YES')
	else:
		print('NO')


def main():
	for _ in range(int(input())):
		(a, b, n, S) = map(int, input().split())
		x = S % n
		if x > b:
			print('NO')
			continue
		elif a * n + b >= S:
			print('YES')
		else:
			print('NO')
main()


tests_no = int(input())
tests = [input().split() for _ in range(tests_no)]
for test in tests:
	(a, b, n, s) = [int(x) for x in test]
	total = a * n + b
	if total < s:
		print('NO')
		continue
	n_coins = s // n
	if n_coins <= a:
		one_coins = s - n_coins * n
		if one_coins <= b:
			print('YES')
			continue
		print('NO')
	else:
		one_coins = s - a * n
		if one_coins <= b:
			print('YES')
			continue
		print('NO')


def coin_possibility(a, b, n, S):
	total_sum_available = a * n + b
	if total_sum_available < S:
		return 'NO'
	if b < S % n:
		return 'NO'
	return 'YES'
n_test = int(input())
answer = []
for _ in range(n_test):
	(a, b, n, S) = list(map(int, input().split()))
	answer.append(coin_possibility(a, b, n, S))
[print(i) for i in answer]


import sys
import math
input = sys.stdin.readline

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
for i in range(int(input())):
	(n, ones, val, sumi) = int_array()
	if sumi // val <= n:
		if sumi - val * (sumi // val) <= ones:
			print('YES')
		else:
			print('NO')
	elif val * n + ones >= sumi:
		n += ones // val
		if sumi - val * (sumi // val) <= ones:
			print('YES')
	else:
		print('NO')


import sys
from collections import Counter

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	(a, b, n, sm) = MAP()
	ans = min(sm // n, a) * n
	if ans + b >= sm:
		YES()
	else:
		NO()


import sys, os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
test = int(input())
for t in range(test):
	(a, b, n, s) = map(int, input().split())
	r = s % n
	q = s // n
	if b >= r:
		if a >= q:
			print('YES')
		elif a < q and b - (q - a) * n >= r:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


n = int(input())
ss = []
for i in range(n):
	ss += [input()]
for i in range(n):
	s = ss[i].split(' ')
	a = int(s[0])
	b = int(s[1])
	n = int(s[2])
	s = int(s[3])
	if min(int(s / n), a) * n + b >= s:
		print('YES')
	else:
		print('NO')


q = int(input())
for j in range(q):
	[a, b, n, S] = list(map(int, input().rstrip().split()))
	grandi = min(S // n, a)
	if S - n * grandi <= b:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, n, s) = [int(x) for x in input().split()]
	x = a * n + b
	if x < s:
		print('NO')
	else:
		p = s % n
		if p <= b:
			print('YES')
		else:
			print('NO')


from sys import stdin, stdout
t = int(stdin.readline())
for a in range(t):
	x = stdin.readline()
	l = list(map(int, x.split()))
	a = l[0]
	b = l[1]
	n = l[2]
	s = l[3]
	coins_n = s // n
	coins_1 = s % n
	if coins_n <= a and coins_1 <= b:
		print('YES')
	elif coins_n >= a and coins_1 < b:
		rem = s - a * n
		if rem <= b:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


q = int(input())
while q:
	(a, b, n, s) = [int(x) for x in input().split()]
	s -= min(s // n, a) * n
	if s <= b:
		print('YES')
	else:
		print('NO')
	q -= 1


t = int(input())
while t:
	(a, b, n, s) = list(map(int, input().split()))
	if s - min(s // n, a) * n <= b:
		print('YES')
	else:
		print('NO')
	t -= 1


t = int(input())
for i in range(t):
	(a, b, n, S) = map(int, input().split())
	total = a * n + b
	if total < S:
		print('NO')
	elif total == S:
		print('YES')
	else:
		diff = total - S
		if diff <= b:
			print('YES')
		else:
			diff = diff % n
			if diff == 0 or diff <= b:
				print('YES')
			else:
				print('NO')


def inp():
	return int(input())

def minput():
	return map(int, input().split())

def linput():
	return list(minput())
for q in range(inp()):
	(a, b, n, s) = minput()
	a = min(s // n, a)
	if s - a * n <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
ls = []
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	ls.append('YES' if S - min(a, S // n) * n <= b else 'NO')
print('\n'.join(ls))


k = int(input())
for i in range(k):
	(a, b, n, S) = list(map(int, input().split()))
	ans = S // n
	if a < ans:
		ans = a
	if S - ans * n - b <= 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	l = list(map(int, input().split()))
	a = l[3]
	b = l[3] % l[2]
	c = l[0] * l[2]
	if l[1] >= b and a - c <= l[1]:
		print('YES')
	else:
		print('NO')


n = int(input())
for x in range(n):
	(a, b, n, s) = map(int, input().split())
	if a * n >= s:
		r = s % n
	else:
		r = s - a * n
	if b >= r:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	z = a * n
	if s <= z + b:
		y = s % n
		if b >= y:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


def inp():
	return int(input())

def minput():
	return map(int, input().split())

def linput():
	return list(minput())
for _ in range(inp()):
	(a, b, n, s) = minput()
	if a * n > s and s % n <= b:
		print('YES')
	elif a * n <= s <= a * n + b:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	(a, b, n, s) = map(int, input().split())
	k = s // n
	k1 = s % n
	if a >= k and b >= k1 or (a < k and s - a * n <= b):
		print('YES')
	else:
		print('NO')
	t -= 1


def calc():
	(a, b, n, s) = (int(j) for j in input().strip().split())
	res = 'NO'
	if s % n <= b:
		if a * n + b >= s:
			res = 'YES'
	return res

def main():
	q = int(input())
	for _ in range(q):
		print(calc())
main()


q = int(input())
for i in range(q):
	(a, b, n, S) = [int(i) for i in input().split()]
	max_a = S // n
	max_current = a * n + b
	if max_current < S:
		print('NO')
	elif a >= max_a and b >= S - max_a * n:
		print('YES')
	elif a < max_a and b >= S - a * n:
		print('YES')
	else:
		print('NO')


q = int(input())
out = []
for i in range(q):
	ar = [int(c) for c in input().split()]
	if ar[3] // ar[2] <= ar[0] and ar[3] % ar[2] <= ar[1]:
		out.append('YES')
	elif ar[3] - ar[2] * ar[0] <= ar[1] and ar[3] - ar[2] * ar[0] >= 0:
		out.append('YES')
	else:
		out.append('NO')
for i in range(q):
	print(out[i])


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	a_count = int(s / n)
	if a_count > a:
		a_count = a
	rem = s - n * a_count
	if rem > b:
		ans = 'NO'
	else:
		ans = 'YES'
	print(ans)


q = int(input())
while q:
	(a, b, n, s) = list(map(int, input().split()))
	if s - b <= a * n and s % n <= b:
		print('YES')
	else:
		print('NO')
	q = q - 1


T = int(input())
while T > 0:
	T -= 1
	(a, b, n, s) = map(int, input().split())
	if a * n + b < s:
		print('NO')
	else:
		num = min(s // n, a)
		if num * n + b >= s:
			print('YES')
		else:
			print('NO')


q = int(input())
for qi in range(q):
	(a, b, n, S) = map(int, input().split())
	number_of_a = S // n
	S -= min(number_of_a, a) * n
	if S <= b:
		print('YES')
	else:
		print('NO')


def func():
	count = 0
	(a, b, val, s) = map(int, input().split())
	if s % val > b or a * val + b < s:
		print('NO')
		return
	print('YES')
n = int(input())
for i in range(n):
	func()


q = int(input())
for zzz in range(q):
	(a, b, n, s) = map(int, input().split())
	if a * n < s:
		if a * n + b >= s:
			print('YES')
		else:
			print('NO')
	elif a * n > s:
		if s % n <= b:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	reminder = s % n
	d = int((s - reminder) / n)
	if a >= d:
		if s - d * n <= b:
			print('YES')
		else:
			print('NO')
	elif s - a * n <= b:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if a * n + b < s:
		print('NO')
	else:
		req = s // n
		if req <= a:
			if req * n + b >= s:
				print('YES')
			else:
				print('NO')
		else:
			s -= req * n
			if b >= s:
				print('YES')
			else:
				print('NO')


t = int(input())
for l in range(t):
	(a, b, n, s) = map(int, input().split())
	if a * n >= s:
		rem = s % n
		if rem <= b:
			print('YES')
		else:
			print('NO')
	else:
		s -= a * n
		if s <= b:
			print('YES')
		else:
			print('NO')


q = int(input())
mas_data = []
d = 0
i = 0
VREM = 0
VREM2 = 0
VREM3 = 0
while i < q:
	(a, b, n, S) = map(int, input().split())
	VREM = int(S / n)
	if VREM > a:
		VREM2 = a * n
	else:
		VREM2 = VREM * n
	if VREM2 + b >= S:
		mas_data.append(1)
	else:
		mas_data.append(0)
	i += 1
i = 0
while i < q:
	if mas_data[i] == 1:
		print('YES')
	if mas_data[i] == 0:
		print('NO')
	i += 1


Tests = input('')
Tests = int(Tests)
outs = []
for i in range(Tests):
	can = True
	line = input('')
	inputs = line.split()
	a = int(inputs[0])
	b = int(inputs[1])
	c = int(inputs[2])
	d = int(inputs[3])
	if d < c:
		if d > b:
			can = False
	else:
		(const, rem) = divmod(d, c)
		if const < a:
			if rem > b:
				can = False
		elif const >= a:
			if a * c + b < d:
				can = False
	if can:
		outs.append('YES')
	else:
		outs.append('NO')
for i in range(Tests):
	print(f'{outs[i]}')


for i in range(int(input())):
	(a, b, n, s) = list(map(int, input().strip().split()))
	p = int(s / n)
	if s <= b or (p <= a and p * n >= s - b and (p * n <= s)) or (a * n >= s - b and a * n <= s):
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	abns = list(map(int, input().strip().split()))
	a = abns[0]
	b = abns[1]
	n = abns[2]
	S = abns[3]
	x = S // n
	x = min(a, x)
	S -= x * n
	if b >= S:
		print('YES')
	else:
		print('NO')


import math, string, itertools, fractions, heapq, collections, re, array, bisect
q = int(input())
for i in range(q):
	(A, B, N, S) = map(int, input().split())
	if N > S:
		if B >= S:
			print('YES')
			continue
		else:
			print('NO')
			continue
	if A * N <= S:
		if S - A * N <= B:
			print('YES')
		else:
			print('NO')
		continue
	works = False
	a = max(1, S // N - 2)
	while a * N <= S:
		if S - a * N <= B:
			works = True
		a += 1
	if works:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
import bisect
import math

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def gcd(a, b):
	while b:
		a = a % b
		(b, a) = (a, b)
	return a

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
		a *= a
		n = n >> 1
	return r

def solve():
	(a, b, n, s) = mp()
	if n * min(a, s // n) + b >= s or b + n * min(a, (s - b) // n) >= s:
		print('YES')
	else:
		print('NO')
for _ in range(inp()):
	solve()


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	while x != link[x]:
		x = link[x]
	return x

def union(x, y, size, link):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	(a, b, n, s) = int_array()
	ans = min(a * n, s // n * n) + b
	if ans >= s:
		print('YES')
	else:
		print('NO')


N = int(input())
for i in range(N):
	Ans = input().split()
	a = int(Ans[0])
	b = int(Ans[1])
	c = int(Ans[2])
	d = int(Ans[3])
	if b >= d % c and a * c + b >= d:
		print('YES')
	else:
		print('NO')


q = int(input())
coins = []
for i in range(q):
	coins.append([int(x) for x in input().split()])
for j in range(q):
	a = coins[j][0]
	b = coins[j][1]
	n = coins[j][2]
	S = coins[j][3]
	quo = S // n
	reminder = S % n
	if quo <= a and reminder <= b:
		print('YES')
	elif b >= S - quo * n and quo <= a:
		print('YES')
	elif b >= S - a * n and a < quo:
		print('YES')
	else:
		print('NO')


def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
import math
import bisect
t = ii()
for i in range(t):
	(a, b, n, s) = mi()
	c = s % n
	if c > b:
		print('NO')
	else:
		d = s // n
		if d <= a:
			print('YES')
		else:
			s -= a * n
			if s <= b:
				print('YES')
			else:
				print('NO')


t = int(input())
for i in range(t):
	st = [int(x) for x in input().split()]
	(a, b, n, s) = [int(x) for x in st]
	x = min(s // n, a)
	y = s - x * n
	if y > b:
		print('NO')
	else:
		print('YES')


q = int(input())
for _ in range(q):
	(a, b, n, S) = [int(t) for t in input().split(' ')]
	aget = min(S // n, a)
	rem = S - aget * n
	if rem <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(a, b, n, s) = list(map(int, input().split()))
	qx = s // n
	qy = s - min(qx, a) * n
	if qy <= b:
		print('YES')
	else:
		print('NO')


def decide(a, b, n, s):
	if s // n <= a and s % n <= b:
		return 'YES'
	if a * n > s:
		if s // n < b:
			return 'NO'
	elif s - a * n <= b:
		return 'YES'
	return 'NO'
t = int(input())
for _ in range(t):
	(a, b, n, s) = list(map(int, input().strip().split()))
	print(decide(a, b, n, s))


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split(' '))
	required = s // n
	a_there = min(a, required)
	if s - a_there * n <= b:
		print('YES')
	else:
		print('NO')


from sys import stdin
stdin.readline

def mp():
	return list(map(int, stdin.readline().strip().split()))

def it():
	return int(stdin.readline().strip())
for _ in range(it()):
	(a, b, n, s) = mp()
	rem = s % n
	if b >= rem:
		if s - n * a <= b:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


q = int(input())
l = []
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	if s > n * a + b:
		l.append('NO')
	elif s - s // n * n > b:
		l.append('NO')
	else:
		l.append('YES')
for i in l:
	print(i)


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	ans = s // n
	su = 0
	flag = 0
	if ans <= a:
		su = su + ans * n
		if s - su <= b:
			flag = 1
	elif ans > a:
		su = su + a * n
		if s - su <= b:
			flag = 1
	print('YES' if flag == 1 else 'NO')


n = int(input())
for i in range(0, n):
	p = input().rstrip().split(' ')
	a = int(p[0])
	b = int(p[1])
	n = int(p[2])
	s = int(p[3])
	x = s // n
	if x > a:
		y = x - a
		x = x - y
	x = n * x
	V = s - x
	if b >= V:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(nn, one, n, s) = map(int, input().split())
	if nn * n <= s:
		ch = nn * n
	else:
		chh = s // n
		ch = chh * n
	if s - ch <= one:
		print('YES')
	else:
		print('NO')


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	(a, b, n, s) = invr()
	A = s // n
	A = min(A, a)
	B = s - n * A
	if B <= b:
		print('YES')
	else:
		print('NO')


import math
from collections import defaultdict, Counter, deque

def primeFactor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def main():
	(a, b, n, s) = map(int, input().split())
	if b == s:
		print('YES')
		return
	multiple = s - s % n
	x = multiple // n
	if x > a:
		x = a
	if x * n + b >= s:
		print('YES')
	else:
		print('NO')
t = int(input())
for _ in range(t):
	main()


cnt = int(input())
res = []
for i in range(cnt):
	(a, b, n, s) = [int(i) for i in input().split(' ')]
	if n * a < s:
		if s - n * a > b:
			res.append(False)
		else:
			res.append(True)
	elif n * a > s:
		if s % n > b:
			res.append(False)
		else:
			res.append(True)
	else:
		res.append(True)
for val in res:
	print('YES' if val == True else 'NO')


T = int(input())
for t in range(T):
	(a, b, n, S) = [int(x) for x in input().split()]
	k = S // n
	S = S - min(k, a) * n
	if S <= b:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, S) = map(int, input().split())
	S = S - min(a, S // n) * n
	print(['NO', 'YES'][S <= b])


def pr():
	(a, b, n, s) = map(int, input().split(' '))
	if s > a * n + b:
		return 'NO'
	else:
		k = s // n
		p = s % n
		if a >= k:
			if b >= p:
				return 'YES'
			return 'NO'
		else:
			s -= n * a
			if s > b:
				return 'NO'
			return 'YES'
q = int(input())
for i in range(q):
	print(pr())


for i in range(int(input())):
	a = list(map(int, input().strip().split()))[:4]
	c = int(a[3] / a[2])
	if c > a[0]:
		c = a[0]
	if c * a[2] + a[1] < a[3]:
		print('NO')
	else:
		print('YES')


q = int(input())
for i in range(q):
	(a, b, n, S) = map(int, input().strip().split())
	required = S // n
	if a >= required:
		new_sum = S - required * n
	else:
		new_sum = S - a * n
	if new_sum > b:
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	l = list(map(int, input().split()))
	print('YES' if l[3] <= l[0] * l[2] + l[1] and l[3] % l[2] <= l[1] else 'NO')


import sys
q = int(next(sys.stdin))
for _ in range(q):
	(a, b, n, S) = map(int, next(sys.stdin).split(' '))
	print('YES' if S - n * min(a, S // n) <= b else 'NO')


q = int(input())
for i in range(q):
	(a, b, n, s) = [int(x) for x in input().split()]
	if s % n == 0 and a >= s // n:
		print('YES')
	elif s % n != 0 and a >= s // n and (n * (s // n) + b >= s):
		print('YES')
	elif s % n != 0 and a >= s // n and (n * (s // n) + b < s):
		print('NO')
	elif a < s // n and n * a + b >= s:
		print('YES')
	elif a < s // n and n * a + b < s:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if a * n + b < s:
		print('NO')
	else:
		print('YNEOS'[s % n > b::2])


def enough_coins(a, b, n, s):
	temp = min(s // n, a)
	if s - temp * n <= b:
		return 'YES'
	else:
		return 'NO'
q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	print(enough_coins(a, b, n, s))


def proba(a, b, n, s):
	if s > a * n + b:
		return 'NO'
	if s < a * n:
		x = s // n
		if b >= s - x * n:
			return 'YES'
		return 'NO'
	return 'YES'
q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	print(proba(a, b, n, s))


def f(a, b, n, s):
	if a * n + b < s or s % n > b:
		return 'NO'
	else:
		return 'YES'
N = int(input())
while N > 0:
	(a, b, n, s) = map(int, input().split())
	print(f(a, b, n, s))
	N -= 1


import sys
for i in range(int(input())):
	(a, b, n, S) = map(int, sys.stdin.readline().split())
	tot = n * a + b
	if S <= tot and S % n <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
answer = []
for i in range(t):
	(a, b, n, s) = list(map(int, input().split()))
	ans = 'NO'
	if a * n + b >= s:
		s %= n
		if s <= b:
			ans = 'YES'
	answer.append(ans)
for i in range(t):
	print(answer[i])


a = int(input())
no_of_lines = a
lines = ''
for i in range(a):
	lines += input() + '\n'
b = lines.split()
for i in range(0, a):
	if int(b[4 * i + 3]) <= int(b[4 * i]) * int(b[4 * i + 2]) + int(b[4 * i + 1]) and int(b[4 * i + 3]) % int(b[4 * i + 2]) <= int(b[4 * i + 1]):
		print('YES')
	else:
		print('NO')


def solve(a: int, b: int, n: int, s: int) -> str:
	x = min(a, s // n)
	remain = s - x * n
	if remain <= b:
		return 'YES'
	return 'NO'

def main():
	for _ in range(int(input())):
		items = map(int, input().split())
		print(solve(*items))
main()


import math
T = int(input())
for i in range(T):
	(a, b, n, s) = map(int, input().split())
	x = s // n
	x = min(x, a)
	s -= x * n
	if s <= b:
		print('YES')
	else:
		print('NO')


import math

def inp_n():
	return int(input())

def inp_list():
	return list(map(int, input().split()))

def inp_mul_num():
	return map(int, input().split())

def is_odd(n):
	if n & 1:
		return True
	return False
for _ in range(inp_n()):
	(a, b, n, S) = inp_mul_num()
	d = S // n
	if d <= a:
		if d * n + b >= S:
			print('YES')
		else:
			print('NO')
	elif a * n + b >= S:
		print('YES')
	else:
		print('NO')


import sys
(q,) = map(int, sys.stdin.readline().split())
for _ in range(q):
	(a, b, n, s) = map(int, sys.stdin.readline().split())
	x = min(s // n, a)
	if s - x * n <= b:
		print('YES')
	else:
		print('NO')


def ans(a, b, n, S):
	numOfa = S // n
	remOfa = S % n
	if numOfa <= a:
		if b >= remOfa:
			return 'YES'
	else:
		required = a * n
		if S - required <= b:
			return 'YES'
	return 'NO'
t = int(input())
for i in range(t):
	(a, b, n, S) = map(int, input().split())
	print(ans(a, b, n, S))


q = int(input())
ans = ['NO'] * q
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	if a * n + b >= s and b >= s % n:
		ans[i] = 'YES'
for x in ans:
	print(x)


t = int(input())
while t > 0:
	li = list(map(int, input().split()))
	(a, b, n, s) = (li[0], li[1], li[2], li[3])
	k = int(s / n)
	if k <= a:
		count = k * n
	else:
		count = a * n
	if count == s:
		print('YES')
	elif s - count <= b:
		print('YES')
	else:
		print('NO')
	t -= 1


q = int(input())
for i in range(1, q + 1):
	y = list(map(int, input().split()))
	total = y[2] * y[0] + y[1]
	if y[3] <= total:
		if y[3] % y[2] <= y[1]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


q = int(input())
for time in range(q):
	(quantityN, quantity1, N, required) = map(int, input().split())
	mult = required // N
	if mult >= quantityN:
		aux = quantityN * N
	else:
		aux = mult * N
	if aux + quantity1 >= required:
		print('YES')
	else:
		print('NO')


def main():
	t = int(input())
	for t in range(t):
		(a, b, n, S) = [int(i) for i in input().split()]
		Sa = S - min(S // n, a) * n
		if Sa > b:
			print('NO')
		else:
			print('YES')
main()


q = int(input())
for i in range(q):
	(a, b, n, s) = [int(i) for i in input().split(' ')]
	temp = s // n
	if a >= temp:
		val = s - temp * n
		if b >= val:
			print('YES')
		else:
			print('NO')
	else:
		val = s - a * n
		if b >= val:
			print('YES')
		else:
			print('NO')


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
for _ in range(int(input())):
	(a, b, n, S) = [int(x) for x in input().split()]
	paid = min(a, S // n) * n
	if S - paid <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	str = input()
	a = int(str.split()[0])
	b = int(str.split()[1])
	y = int(str.split()[2])
	s = int(str.split()[3])
	if (y > s or a == 0) and b >= s:
		print('YES')
	elif b == 0 and s % y == 0 and (s // y <= a):
		print('YES')
	elif s // y <= a and s % y <= b:
		print('YES')
	elif a * y <= s and s - a * y <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
ans = [0] * q
for i in range(q):
	(a, b, n, s) = list(map(int, input().split()))
	if a * n + b < s:
		ans[i] = 'NO'
	else:
		k = s // n
		if k * n == s:
			ans[i] = 'YES'
		elif k * n + b < s:
			ans[i] = 'NO'
		else:
			ans[i] = 'YES'
print('\n'.join(ans))


t = int(input())
for _ in range(t):
	(a, b, n, s) = map(int, input().split())
	x = s // n
	y = s % n
	f = 0
	if x <= a:
		if y <= b:
			f = 1
		else:
			f = 0
	else:
		t = x - a
		if n * t + y <= b:
			f = 1
		else:
			f = 0
	if f == 1:
		print('YES')
	else:
		print('NO')


from sys import stdin

def solution(t: int) -> None:
	input = stdin.readline
	res_arr = []
	for i in range(t):
		(a, b, n, S) = map(int, input().split())
		temp = min(S // n, a)
		res_arr.append(['NO', 'YES'][S - temp * n <= b])
	print('\n'.join(map(str, res_arr)))

def main():
	t = int(input())
	solution(t)
main()


n = int(input())
for i in range(n):
	li = [int(x) for x in input().split(' ')]
	a = li[0]
	b = li[1]
	n = li[2]
	s = li[3]
	if s - a * n > 0:
		s -= a * n
	else:
		s %= n
	if s <= b:
		print('YES')
	else:
		print('NO')


from sys import stdin
from collections import defaultdict

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
q = int(stdin.readline().strip())
for _ in range(q):
	(a, b, n, s) = list(map(int, stdin.readline().split()))
	if s // n <= a:
		s = s % n
		if s <= b:
			print('YES')
		else:
			print('NO')
	else:
		s -= n * a
		if s <= b:
			print('YES')
		else:
			print('NO')


import sys
q = int(sys.stdin.readline())
ans_arr = []
for x in range(q):
	[a, b, n, S] = [int(i) for i in sys.stdin.readline().split()]
	if S // n <= a:
		if S - S // n * n <= b:
			ans_arr.append('YES')
		else:
			ans_arr.append('NO')
	elif S - a * n <= b:
		ans_arr.append('YES')
	else:
		ans_arr.append('NO')
print('\n'.join(ans_arr))


def query(a, b, n, s):
	if n > s > b:
		return 'NO'
	elif s >= n and s // n <= a and (s % n <= b):
		return 'YES'
	elif s >= a * n and s - a * n <= b:
		return 'YES'
	elif n <= s - b == (s - b) // n * n and (s - b) // n <= a:
		return 'YES'
	elif s - b <= 0:
		return 'YES'
	else:
		return 'NO'

def main():
	for i in range(int(input())):
		(a, b, n, s) = map(int, input().split(' '))
		print(query(a, b, n, s))
main()


q = int(input())

def divides(x, b, c):
	return c % gcd(a, b) == 0
from math import gcd
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	req = s // n
	if a >= req and b >= s - n * req:
		print('YES')
	elif a < req and b >= s - a * n:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.buffer.readline
from collections import defaultdict

def getlist():
	return list(map(int, input().split()))

def main():
	Q = int(input())
	for i in range(Q):
		(a, b, n, S) = getlist()
		if a * n + b < S:
			print('NO')
		elif S - a * n < 0:
			if S % n <= b:
				print('YES')
			else:
				print('NO')
		elif S - a * n <= b:
			print('YES')
		else:
			print('NO')
main()


from sys import stdin
q = int(stdin.readline().rstrip())
for _ in range(q):
	(a, b, n, S) = [int(x) for x in stdin.readline().rstrip().split()]
	S -= min(a, S // n) * n
	if S <= b:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(0, n):
	x = input().split(' ')
	x = list(map(int, x))
	a = x[0]
	b = x[1]
	c = x[2]
	s = x[3]
	k = s // c
	if k > a:
		z = a * c
	else:
		z = k * c
	m = s - z
	if m > b:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(a, b, n, s) = (int(x) for x in input().split())
	need_a = s // n
	if need_a > a:
		need_to_pay = s - a * n
		if need_to_pay <= b:
			print('YES')
		else:
			print('NO')
	else:
		need_to_pay = s - need_a * n
		if need_to_pay <= b:
			print('YES')
		else:
			print('NO')


def provider(a, b, n, S):
	if S > a * n + b:
		return 'NO'
	if S == a * n + b:
		return 'YES'
	else:
		quo = S // n
		mul = quo - a
		rem = S % n
		if mul > 0:
			act = rem + mul * n
		else:
			act = rem
		if quo - mul <= a and act <= b:
			return 'YES'
		else:
			return 'NO'
t = int(input())
ans = []
for i in range(t):
	(a, b, n, S) = [int(i) for i in input().split()]
	ans.append(provider(a, b, n, S))
for i in ans:
	print(i)


q = int(input())
for j in range(q):
	(a, b, n, s) = map(int, input().split())
	res = s // n
	if res <= a:
		opa = res
	else:
		opa = a
	s -= opa * n
	if s <= b:
		print('YES')
	else:
		print('NO')


cases = int(input())
for i in range(cases):
	(a, b, n, S) = [int(x) for x in input().split()]
	su = 0
	poss = S // n
	if poss <= a:
		su += poss * n
	else:
		su += a * n
	if S - su > b:
		print('NO')
	else:
		print('YES')


from math import ceil

def solve():
	t = int(input())
	for _ in range(t):
		(a, b, n, s) = map(int, input().split())
		r = s % n
		if r > b or a * n + b < s:
			print('NO')
		else:
			print('YES')
solve()


q = int(input())
for i in range(q):
	(a, b, n, S) = [int(k) for k in input().split()]
	if a * n < S and S - a * n <= b or (S // n <= a and S % n <= b):
		print('YES')
	else:
		print('NO')


b = 1
countData = int(input())
i = 0
while i < countData:
	str = input().split()
	countA = int(str[0])
	countB = int(str[1])
	n = int(str[2])
	sum = int(str[3])
	if countA * n < sum:
		if countA * n + countB >= sum:
			print('YES')
		else:
			print('NO')
	if countA * n > sum:
		if sum % n <= countB:
			print('YES')
		else:
			print('NO')
	if countA * n == sum:
		print('YES')
	i += 1


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	cur = n
	use = 0
	if n <= s:
		need = s // n
		use = min(need, a)
	cur = use * n
	if b >= s - cur:
		print('YES')
	else:
		print('NO')


def f(a, b, n, S):
	min = (S - b) / n
	max = S / n
	t = max // 1
	if max <= a:
		if t >= min:
			print('YES')
		else:
			print('NO')
	elif a >= min:
		print('YES')
	else:
		print('NO')
q = int(input())
for i in range(q):
	lst = list(map(int, input().split()))
	f(lst[0], lst[1], lst[2], lst[3])


x = eval(input())
for i in range(x):
	y = input().split(' ')
	a = int(y[0])
	b = int(y[1])
	n = int(y[2])
	s = int(y[3])
	if s - a * n <= b and s - s // n * n <= b:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	(cns_va, cns1, va, sm) = list(map(int, stdin.readline().split()))
	needed = sm // va
	summade = min(needed, cns_va) * va
	diff = sm - summade
	if cns1 >= diff:
		print('YES')
	else:
		print('NO')


def coins(a, b, n, S):
	if S < n:
		if b >= S:
			return 1
		else:
			return 0
	else:
		if n * a >= S:
			u = S % n
		else:
			u = S - n * a
		if b >= u:
			return 1
		else:
			return 0
t = int(input())
for i in range(t):
	(a, b, n, S) = input().split()
	a = int(a)
	b = int(b)
	n = int(n)
	S = int(S)
	if coins(a, b, n, S) == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(a, b, n, s) = map(int, input().split())
	maxn = n * a
	if maxn >= s:
		nnum = s // n
		onum = s % n
		if nnum <= a and onum <= b:
			print('YES')
		else:
			print('NO')
	else:
		s -= maxn
		nnum = a
		onum = s
		if nnum <= a and onum <= b:
			print('YES')
		else:
			print('NO')


r = int(input())
l = []
for i in range(r):
	(a, b, n, s) = input().split()
	a = int(a)
	b = int(b)
	s = int(s)
	n = int(n)
	if s >= a * n:
		s -= a * n
		if b >= s:
			l.append('YES')
		else:
			l.append('NO')
	elif s < a * n:
		s = s - s // n * n
		if b >= s:
			l.append('YES')
		else:
			l.append('NO')
for t in range(r):
	print(l[t])


t = int(input())
for t in range(t):
	(a, b, n, s) = map(int, input().split())
	d = 0
	q = s // n
	if q <= a:
		if b >= s % n:
			d = 1
	else:
		s = s - n * a
		if s <= b:
			d = 1
	if d == 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	v = a * n + b
	if v == s:
		print('YES')
	elif v < s:
		print('NO')
	else:
		x = a * n
		if x == s or b == s:
			print('YES')
		elif x < s and b >= s - x:
			print('YES')
		elif x > s:
			h = s // n
			if b >= s - h * n:
				print('YES')
			else:
				print('NO')


t = int(input())
for test in range(t):
	(a, b, n, s) = [int(x) for x in input().split()]
	y = s // n
	if y <= a:
		s = s - y * n
		if s <= b:
			print('YES')
		else:
			print('NO')
	else:
		s = s - a * n
		if s <= b:
			print('YES')
		else:
			print('NO')


def main():
	t = int(input())
	for _ in range(t):
		(a, b, n, s) = map(int, input().split())
		div = s // n
		rem = s % n
		if rem > b or (div > a and a * n + b < s):
			print('NO')
		else:
			print('YES')
main()


def sol():
	(a, b, n, s) = list(map(int, input().split()))
	total = 0
	nb = min(s // n, a)
	total += nb * n
	rem = s - total
	if b >= rem:
		print('YES')
	else:
		print('NO')

def main():
	q = int(input())
	for t in range(q):
		sol()
main()


__version__ = '0.1'
__date__ = '2019-11-19'
import sys

def solve(a, b, n, S):
	if n * min(a, S // n) + b >= S:
		return True
	return False

def main(argv=None):
	q = int(input())
	for each in range(q):
		(a, b, n, S) = map(int, input().split())
		if solve(a, b, n, S):
			print('YES')
		else:
			print('NO')
	return 0
STATUS = main()
sys.exit(STATUS)


q = int(input())
while q:
	(a, b, n, S) = map(int, input().split())
	if b >= S % n and a * n + b >= S:
		print('YES')
	else:
		print('NO')
	q -= 1


q = int(input())
for __ in [0] * q:
	(a, b, n, s) = map(int, input().split())
	xx = min(s // n, a)
	s -= xx * n
	if s <= b:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	l = (s - b + n - 1) // n
	r = s // n
	print('YES' if l <= r and l <= a else 'NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	ch = 0
	if n > s:
		if s <= b:
			ch = 1
		else:
			ch = -1
	elif a * n >= s:
		k = s // n
		s = s - k * n
		if s <= b:
			ch = 1
		else:
			ch = -1
	else:
		s = s - a * n
		if s <= b:
			ch = 1
		else:
			ch = -1
	if ch == -1:
		print('NO')
	elif ch == 1:
		print('YES')


t = int(input())
for _ in range(t):
	(a, b, n, s) = map(int, input().split(' '))
	bol = False
	while a >= 0:
		if a * n > s:
			a = s // n
		elif a * n == s:
			bol = True
			print('YES')
			break
		else:
			if s - a * n <= b:
				bol = True
				print('YES')
			break
	if not bol:
		print('NO')


q = int(input())
for i in range(q):
	z = input().split()
	for j in range(4):
		z[j] = int(z[j])
	if z[3] % z[2] <= z[1] and z[0] * z[2] + z[1] >= z[3]:
		print('YES')
	else:
		print('NO')


q = int(input())
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	possible = False
	x = 0
	if n * a < S:
		if S - n * a <= b:
			possible = True
	else:
		x = S // n
		if S - n * x <= b:
			possible = True
	if possible:
		print('YES')
	else:
		print('NO')


def process_case():
	(a, b, n, S) = map(int, input().split())
	x = min(S // n, a)
	y = S - n * x
	if y <= b:
		print('YES')
	else:
		print('NO')
tests_count = int(input())
for _ in range(tests_count):
	process_case()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = I()
	rr = []
	for _ in range(t):
		(a, b, n, s) = LI()
		s -= min(a, s // n) * n
		rr.append(IF(s <= b, 'YES', 'NO'))
	return JA(rr, '\n')
print(main())


m = int(input())
for i in range(m):
	(a, b, n, S) = map(int, input().split())
	if a * n <= S:
		max_with_n_only = a * n
	else:
		max_with_n_only = S // n * n
	print('YES') if max_with_n_only + b >= S else print('NO')


for _ in range(int(input())):
	abnS = list(str(input()).split(' '))
	a = int(abnS[0])
	b = int(abnS[1])
	n = int(abnS[2])
	S = int(abnS[3])
	answer = ''
	if a * n + b < S:
		answer = 'NO'
	elif a * n + b == S:
		answer = 'YES'
	elif S % n <= b:
		answer = 'YES'
	else:
		answer = 'NO'
	print(answer)


n1 = int(input())
for x in range(n1):
	n2 = list(map(int, input().split(' ')[:4]))
	a = n2[0]
	b = n2[1]
	n = n2[2]
	s = n2[3]
	if a * n + b >= s and s % n <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b, n, s) = input().split(' ')
	a = int(a)
	b = int(b)
	s = int(s)
	n = int(n)
	diff = s % n
	val = s // n
	if diff <= b and a * n + b >= s:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	i = 0
	print(['NO', 'YES'][a * n + b >= s and b >= s % n])


for _ in [0] * int(input()):
	(a, b, n, s) = list(map(int, input().split()))
	count = a * n + b
	if count < s:
		print('NO')
	elif 0 <= count - s and count - s <= b:
		print('YES')
	elif b - s % n >= 0 and (b - s % n) // n + a >= s // n:
		print('YES')
	else:
		print('NO')


def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def mp():
	return map(int, input().split())

def i():
	return input()
from collections import Counter
from math import floor, ceil, gcd, log, sqrt
for _ in range(int(input())):
	(a, b, n, s) = mp()
	quot = s // n
	remain = s - min(quot, a) * n
	if b >= remain:
		print('YES')
	else:
		print('NO')


import sys

def main():
	solns = []
	q = int(sys.stdin.readline())
	for _ in range(q):
		(a, b, n, S) = [int(x) for x in sys.stdin.readline().split()]
		if a * n < S or a * n == S:
			if a * n + b >= S:
				solns += ['YES']
			else:
				solns += ['NO']
		else:
			nearest = n * (S // n)
			if nearest + b >= S:
				solns += ['YES']
			else:
				solns += ['NO']
	print('\n'.join(solns))
main()


import sys
inp = sys.stdin.readline
ans = ''
for _ in range(int(inp())):
	(a, b, n, s) = map(int, inp().split())
	a_needed = s // n
	if a >= a_needed:
		ans += ('YES' if b >= s % n else 'NO') + '\n'
	else:
		ans += ('YES' if b >= s - a * n else 'NO') + '\n'
print(ans)


q = int(input())
t = []
for i in range(q):
	t.append(list(map(int, input().rstrip().split())))
for i in range(q):
	if t[i][0] * t[i][2] >= t[i][3]:
		if t[i][3] % t[i][2] <= t[i][1]:
			print('YES')
		else:
			print('NO')
	elif t[i][3] - t[i][0] * t[i][2] <= t[i][1]:
		print('YES')
	else:
		print('NO')


import math
tc = int(input().strip())
while tc > 0:
	tc -= 1
	(a, b, n, s) = map(int, input().strip().split())
	if n * a != s:
		if n * a > s:
			a = s // n
		if b >= s - n * a:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')


X = ''
for i in range(int(input())):
	(A, B, N, S) = map(int, input().split())
	if A * N + B >= S and S % N <= B:
		X += 'YES\n'
		continue
	else:
		X += 'NO\n'
		continue
print(X)


from math import ceil, floor
q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	start = ceil((s - b) / n)
	end = floor(s / n)
	if max(0, start) > min(a, end):
		print('NO')
	else:
		print('YES')


k = int(input())

def f(a, b, n, s):
	if a * n + b >= s:
		a = s // n
		if a * n + b >= s:
			return 'YES'
		else:
			return 'NO'
	return 'NO'
for i in range(k):
	(a, b, n, s) = map(int, input().split())
	print(f(a, b, n, s))


test = int(input())
for test in range(test, 0, -1):
	(a, b, n, s) = map(int, input().split(' '))
	koy = int(s / n)
	koy = min(koy, a)
	s -= koy * n
	if b >= s:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(a, b, n, s) = map(int, input().split())
	x = min(s // n, a)
	y = s - x * n
	if y > b:
		print('NO')
	else:
		print('YES')


def read_tokens():
	return input().strip().split(' ')

def read_ints():
	return [int(s) for s in read_tokens()]
T = int(input())

def solve(a: int, b: int, n: int, S: int) -> bool:
	if S % n > b:
		return False
	return a * n + b >= S
for test in range(T):
	(a, b, n, S) = read_ints()
	ok = solve(a, b, n, S)
	if ok:
		print('YES')
	else:
		print('NO')


import math
q = int(input())
for i in range(q):
	(a, b, n, S) = [int(x) for x in input().split()]
	l1 = math.ceil((S - b) / n)
	r1 = math.floor(S / n)
	l2 = 0
	r2 = a
	l = max(l1, l2)
	r = min(r1, r2)
	if r >= l:
		print('YES')
	else:
		print('NO')


queries = int(input())
for query in range(queries):
	abns = input().split()
	numofuseda = 0
	a = int(abns[0])
	b = int(abns[1])
	n = int(abns[2])
	s = int(abns[3])
	if a * n >= s:
		s = s - int(s / n) * n
	else:
		s = s - a * n
	if b >= s:
		print('YES')
	else:
		print('NO')


import math
q = int(input())
for _ in range(q):
	(a, b, n, s) = list(map(int, input().split()))
	if s // n <= a:
		if s % n <= b:
			print('YES')
		else:
			print('NO')
	elif math.ceil((s - b) / n) <= a:
		print('YES')
	else:
		print('NO')


q = int(input())
x = 0
v = 0
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	x = a * n + b
	if x < s:
		print('NO')
	elif a >= s // n:
		v = n * (s // n)
		if s - v > b:
			print('NO')
		else:
			print('YES')
	elif n * a + b >= s:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	s = list(map(int, input().split()))
	if s[0] * s[2] + s[1] < s[3]:
		print('NO')
	elif s[0] * s[2] + s[1] == s[3]:
		print('YES')
	else:
		required = s[3] // s[2]
		have = s[0]
		change = required - have
		if change <= 0:
			rem = s[3] - s[2] * (s[3] // s[2])
			if s[1] >= rem:
				print('YES')
			else:
				print('NO')
		else:
			rem = s[3] - have * s[2]
			if s[1] >= rem:
				print('YES')
			else:
				print('NO')


for i in range(int(input())):
	(a, b, n, S) = map(int, input().split())
	sisa = S % n
	b = b - sisa
	if b >= n:
		a = a + b // n
	if S // n <= a and b >= 0:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(a, b, n, S) = input().split()
	a = int(a)
	b = int(b)
	n = int(n)
	S = int(S)
	tot = a * n + b
	if a * n + b < S:
		print('NO')
	elif a * n + b == S:
		print('YES')
	elif a * n > S:
		resto = S % n
		if resto > b:
			print('NO')
		else:
			print('YES')
	else:
		print('YES')


import sys
t = int(sys.stdin.readline())
for i in range(t):
	(a, b, n, s) = list(map(int, sys.stdin.readline().strip().split()))
	f = 0
	if a * n >= s and s % n <= b:
		f = 1
	elif b >= s:
		f = 1
	elif a * n <= s and s - a * n - b <= 0:
		f = 1
	if f:
		print('YES')
	else:
		print('NO')


from fractions import Fraction
import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = pow(10, 9) + 7

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def solve():
	(a, b, n, s) = sep()
	if a * n < s:
		if b >= s - a * n:
			print('YES')
		else:
			print('NO')
	elif b >= s % n:
		print('YES')
	else:
		print('NO')
testcase(int(inp()))


t = int(input())
for i in range(t):
	(a, b, n, s) = list(map(int, input().split(' ')))
	d = a * n + b
	mini = 0
	if n < b:
		mini = n
	else:
		mini = b
	if s > d:
		print('NO')
	elif s <= mini:
		print('YES')
	else:
		m = s % n
		if m <= b:
			print('YES')
		else:
			print('NO')


q = int(input())
for i in range(0, q, 1):
	(a, b, n, s) = input().split()
	a = int(a)
	b = int(b)
	n = int(n)
	s = int(s)
	c1 = int(s / n)
	if a >= c1:
		sum = c1 * n + b
	else:
		sum = a * n + b
	if sum >= s:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	total = 1
	mul = int(s / n)
	total = n * min(mul, a)
	if total > s:
		total -= n
	if total == s or s - total <= b:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if a * n <= s:
		sm = a * n
	else:
		sm2 = s // n
		sm = sm2 * n
	if s - sm <= b:
		print('YES')
	else:
		print('NO')


import sys, atexit
from io import BytesIO
inp = BytesIO(sys.stdin.buffer.read())
input = lambda : inp.readline().decode('ascii')
buf = BytesIO()
atexit.register(lambda : sys.__stdout__.buffer.write(buf.getvalue()))
for i in range(int(input())):
	(a, b, n, S) = map(int, input().split())
	a = min(S // n, a)
	S -= n * a
	if b >= S:
		print('YES')
	else:
		print('NO')


n = int(input())
m = []
for _ in range(n):
	(a, b, n, s) = map(int, input().split())
	if s // n < a:
		m.append('YES' if s % n <= b else 'NO')
	else:
		c = s - a * n
		m.append('YES' if b >= c else 'NO')
print(*m, sep='\n')


x = int(input())
while x > 0:
	x -= 1
	arr = list(map(int, input().split()))
	a = arr[0]
	b = arr[1]
	n = arr[2]
	S = arr[3]
	if S - a * n > 0:
		if S - a * n > b:
			print('NO')
		else:
			print('YES')
	elif S % n > b:
		print('NO')
	else:
		print('YES')


import math
q = int(input())
for _ in range(q):
	(a, b, n, s) = map(float, input().split())
	t = s // n
	t2 = s % n
	if t <= a:
		if t2 <= b:
			print('YES')
		else:
			print('NO')
	elif abs(t - a) * n + t2 <= b:
		print('YES')
	else:
		print('NO')


from sys import stdin
from sys import stdout

def rl():
	return [int(w) for w in stdin.readline().split()]
q = int(stdin.readline())
for x in range(q):
	(a, b, n, S) = rl()
	tmp = min(S // n, a)
	t = S - tmp * n
	if t <= b:
		print('YES')
	else:
		print('NO')


from collections import Counter
from math import gcd

def run_testcase():
	[a, b, n, s] = [int(x) for x in input().split()]
	x = min(s // n, a)
	if x * n + b >= s:
		return 'YES'
	else:
		return 'NO'
testcase_count = int(input())
for i in range(testcase_count):
	print(str(run_testcase()))


import sys
input = sys.stdin.readline
out = sys.stdout

def main():
	q = int(input())
	for i in range(q):
		(a, b, n, s) = map(int, input().split())
		if a * n > s:
			ost = s - s // n * n
			if ost > b:
				print('NO')
			else:
				print('YES')
		elif a * n + b < s:
			print('NO')
		else:
			print('YES')
main()


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if a * n + b < s:
		print('NO')
		continue
	aa = s // n
	s -= n * min(aa, a)
	if b >= s:
		print('YES')
		continue
	print('NO')


for m in range(int(input())):
	abns = list(map(int, input().split()))
	if abns[0] * abns[2] + abns[1] < abns[3]:
		print('NO')
	elif abns[0] * abns[2] + abns[1] == abns[3]:
		print('YES')
	else:
		a = min(abns[3] // abns[2], abns[0])
		if a * abns[2] + abns[1] >= abns[3]:
			print('YES')
		else:
			print('NO')


s = ''
for _ in '0' * int(input()):
	(a, b, n, S) = map(int, input().split())
	s += ('YES' if S - n * min(a, S // n) <= b else 'NO') + '\n'
print(s)


import collections

class Solution:

	def solve(self, a, b, n, S):
		if S % n <= b and a * n + b >= S:
			return True
		else:
			return False
sol = Solution()
q = int(input().strip())
for i in range(q):
	[a, b, n, S] = list(map(int, input().strip().split()))
	print('YES' if sol.solve(a, b, n, S) else 'NO')


q = int(input())
r = []
for i in range(q):
	x = list(map(int, input().split()))
	import math
	a = x[0]
	b = x[1]
	n = x[2]
	s = x[3]
	if s > n * a + b:
		r.append('NO')
	elif s == n * a + b:
		r.append('YES')
	else:
		m = math.floor(s / n)
		o = min(m, a)
		t = s - o * n
		if t <= b:
			r.append('YES')
		else:
			r.append('NO')
for i in range(len(r)):
	print(r[i])


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	total = a * n + b
	if s > total:
		print('NO')
	else:
		temp = s // n
		s -= temp * n
		if s > b:
			print('NO')
		elif s <= b:
			print('YES')


for _ in range(int(input())):
	(a, b, n, s) = [int(x) for x in input().split()]
	print(['NO', 'YES'][a * n + b >= s and s % n <= b])


import sys
IN = sys.stdin.readline
for i in range(int(IN())):
	(a, b, n, s) = map(int, IN().split())
	print('YES' if s <= b or (s // n >= a and a * n + b >= s or (s // n < a and s // n * n + b >= s)) else 'NO')


q = input()
for i in range(int(q)):
	line = input()
	(a, b, n, s) = [int(x) for x in line.split()]
	cn = min(s // n, a)
	if s - n * cn <= b:
		print('YES')
	else:
		print('NO')


number = int(input())
answer_array = []
for i in range(0, number):
	(a, b, n, S) = map(lambda x: int(x), input().split(' '))
	if a * n + b < S:
		answer_array.append('NO')
	elif S % n > b:
		answer_array.append('NO')
	else:
		answer_array.append('YES')
for answer in answer_array:
	print(answer)


tcases = int(input().strip())
for case in range(tcases):
	(a, b, n, S) = map(int, input().strip().split())
	if S > a * n + b:
		print('NO')
	else:
		k = S // n
		if k >= a:
			k = a
		m = S - k * n
		if m <= b:
			print('YES')
		else:
			print('NO')


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	t = a * n + b * 1
	print('YES' if min(s // n, a) * n + b >= s else 'NO')


def solve(a, b, n, S):
	p = S // n
	minVal = min(p, a)
	if minVal * n + b < S:
		return 'NO'
	return 'YES'
m = int(input())
for i in range(m):
	(l1, r1, l2, r2) = map(int, input().split(' '))
	print(solve(l1, r1, l2, r2))


def solution(a, b, n, S):
	temp = S % n
	if b >= temp:
		if a * n >= S - b:
			return 'YES'
		return 'NO'
	return 'NO'
q = int(input())
for _ in range(q):
	(a, b, n, S) = map(int, input().strip().split())
	print(solution(a, b, n, S))


raz = int(input())
for z in range(raz):
	(a, b, n, s) = map(int, input().split())
	if s % n == 0:
		if s / n <= a or b >= s - a * n:
			print('YES')
		else:
			print('NO')
	elif b >= s % n and (a >= s // n or b >= s - a * n):
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(a, b, n, s) = list(map(int, input().strip().split(' ')))
	if n != 0:
		q = s // n
		rem = s % n
		if a >= q:
			if b >= rem:
				print('YES')
				continue
			print('NO')
		else:
			sub = s - a * n
			if b >= sub:
				print('YES')
				continue
			print('NO')
	elif b >= s:
		print('YES')
	else:
		print('NO')


from sys import stdin
c = int(stdin.readline().strip())
for caso in range(c):
	(a, b, n, S) = map(int, stdin.readline().strip().split())
	x = min(a, S // n)
	if S - x * n <= b:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(a, b, n, s) = map(int, input().split())
	print('YNEOS'[min(s // n, a) * n + b < s::2])


x = int(input())
for __ in range(x):
	(a, b, c, d) = map(int, input().split())
	e = d // c
	if e <= a:
		f = d - c * e
		if f <= b:
			print('YES')
		else:
			print('NO')
	else:
		f = d - c * a
		if f <= b:
			print('YES')
		else:
			print('NO')


from sys import stdin, stdout
from collections import defaultdict as df
import bisect
q = int(stdin.readline())
for i in range(q):
	(a, b, n, s) = list(map(int, stdin.readline().split()))
	y = s // n
	remain = s % n
	temp = (s + b) // n
	if a * n + b < s:
		print('NO')
	elif y <= a and remain <= b:
		print('YES')
	elif y > a and s - a * n <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b, n, s) = map(int, input().split())
	if b >= s:
		print('YES')
	else:
		re = s - b
		if re % n == 0 and re // n <= a:
			print('YES')
		else:
			re = s // n
			re = s - min(re, a) * n
			if re <= b:
				print('YES')
			else:
				print('NO')


t = int(input())
queries = []
for _ in range(t):
	(a, b, n, S) = map(int, input().strip().split())
	if max(S - a * n, S % n) <= b:
		print('YES')
	else:
		print('NO')


from math import ceil
q = int(input())
ans = []
for i in range(q):
	(a, b, n, s) = [int(s) for s in input().split()]
	if s % n <= b and ceil((s - b) / n) <= a:
		ans.append('YES')
	else:
		ans.append('NO')
print('\n'.join(ans))


for tc in range(int(input())):
	(a, b, n, S) = map(int, input().split())
	S = max(S % n, S - a * n)
	if S > b:
		print('NO')
	else:
		print('YES')


import sys
input = sys.stdin.readline
from math import floor

def solve(a, b, n, S):
	n_coins = floor(S / n)
	if n_coins > a:
		n_coins = a
	return n_coins * n + b >= S
t = int(input())
for _ in range(t):
	(a, b, n, S) = map(int, input().split())
	if solve(a, b, n, S):
		print('YES')
	else:
		print('NO')


for cas in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if s >= a * n:
		s = s - a * n
	else:
		s = s % n
	if s > b:
		print('NO')
	else:
		print('YES')


def check(a, b, n, S):
	Y = S % n
	if b < Y:
		return False
	k = (b - Y) // n
	y0 = k * n + Y
	x0 = (S - y0) // n
	return x0 <= a
q = int(input())
while q:
	(a, b, n, S) = [int(s) for s in input().split(' ')]
	print(('NO', 'YES')[check(a, b, n, S)])
	q -= 1


q = int(input())
for i in range(q):
	(a, b, c, d) = map(int, input().split())
	if a * c > d:
		d %= c
	else:
		d -= a * c
	print('YES' if d <= b else 'NO')


n = int(input())
a = 0
x = []
for i in range(n):
	x = input().split()
	c = int(x[2]) * int(x[0])
	if c == int(x[3]):
		print('YES')
	else:
		an = int(int(x[3]) / int(x[2]))
		if an > int(x[0]):
			an = int(x[0])
		c = int(x[2]) * an
		if c + int(x[1]) >= int(x[3]):
			print('YES')
		else:
			print('NO')


for i in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	(c, d) = (s // n, s % n)
	if c <= a and d <= b or (c > a and b >= s - a * n):
		print('YES')
	else:
		print('NO')


test = int(input())
ans = []
for i in range(test):
	(a, b, n, s) = map(int, input().split(' '))
	if s >= n:
		x = min(s // n, a)
		s -= x * n
		if s > b:
			ans.append('NO')
		else:
			ans.append('YES')
	elif s <= b:
		ans.append('YES')
	else:
		ans.append('NO')
for each in ans:
	print(each)


t = int(input())
while t != 0:
	(a, b, n, s) = map(int, input().split())
	if a * n + b < s:
		print('NO')
	else:
		minn = min(a, s // n)
		temp = s - minn * n
		if temp > b:
			print('NO')
		else:
			print('YES')
	t -= 1


import sys
input = sys.stdin.readline

def main():
	q = int(input())
	for _ in range(q):
		(a, b, n, S) = [int(x) for x in input().split()]
		is_success = False
		i = (S - b) // n - 1
		for x in range(i, a + 1):
			if 0 <= S - x * n <= b:
				is_success = True
				break
			if S < x * n:
				break
		if is_success:
			print('YES')
		else:
			print('NO')
main()


def main():
	for _ in range(int(input())):
		(a, b, n, s) = map(int, input().split())
		one_coins = s % n
		n_coins = s // n
		ans = 1
		if one_coins > b:
			ans = 0
		elif n_coins > a and (n_coins - a) * n > b - one_coins:
			ans = 0
		else:
			ans = 1
		if ans:
			print('YES')
		else:
			print('NO')
main()


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	a1 = s // n
	b1 = s % n
	if a1 <= a:
		if b >= b1:
			print('YES')
		else:
			print('NO')
	else:
		d = a1 - a
		b2 = d * n
		b1 += b2
		if b >= b1:
			print('YES')
		else:
			print('NO')


sum = 0
tot = 0
for i in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	sum = s // n
	if sum <= a:
		tot = n * sum
		if tot + b >= s:
			print('YES')
		else:
			print('NO')
	else:
		tot = a * n
		if tot + b >= s:
			print('YES')
		else:
			print('NO')


mod = 10 ** 9 + 7
import sys
sys.setrecursionlimit(10 ** 6)
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq
import random

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def main():
	t = inin()
	for _ in range(t):
		(a, b, n, s) = cin()
		q = s // n
		q = min(a, q)
		s -= q * n
		if b >= s:
			print('YES')
		else:
			print('NO')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


R = lambda : map(int, input().split())
for _ in range(int(input())):
	(a, b, n, s) = R()
	p = min(a, s // n)
	if s - p * n <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
while q > 0:
	(a, b, n, s) = [int(i) for i in input().split()]
	if s // n > a:
		p = a
	else:
		p = s // n
	p = p * n
	p = p + b
	print('YES' if p >= s else 'NO')
	q = q - 1


def fun(st):
	li = st.split()
	a = int(li[0])
	b = int(li[1])
	n = int(li[2])
	S = int(li[3])
	if a >= S // n:
		if b >= S % n:
			return 'YES'
		else:
			return 'NO'
	elif b >= S - a * n:
		return 'YES'
	else:
		return 'NO'
q = int(input())
for i in range(q):
	print(fun(input()))


for i in range(int(input())):
	p = list(map(int, input().split()))
	k = min(p[3] // p[2], p[0]) * p[2] + p[1]
	print('YES' if k >= p[3] else 'NO')


for z in range(int(input())):
	(a, b, n, m) = map(int, input().split())
	a1 = m // n
	b1 = m % n
	if m <= a * n + b:
		if a1 > a + b // n or b1 > b:
			print('NO')
		else:
			print('YES')
	else:
		print('NO')


t = []
q = int(input())
for i in range(q):
	a = []
	a = input().split()
	for j in range(4):
		a[j] = int(a[j])
	t.append(a)
for test in t:
	s = test[2] * test[0]
	if s == test[3] or test[1] >= test[3]:
		print('YES')
	elif test[2] > test[3]:
		print('NO')
	elif s > test[3] and test[1] >= test[3] % test[2]:
		print('YES')
	elif s < test[3] and s + test[1] >= test[3]:
		print('YES')
	else:
		print('NO')


q = int(input())
for each in range(1, q + 1):
	(a, b, n, s) = input().split()
	if int(a) * int(n) == int(s):
		print('YES')
	elif int(a) * int(n) < int(s):
		diff = int(s) - int(a) * int(n)
		if diff > int(b):
			print('NO')
		else:
			print('YES')
	else:
		diff = int(s) % int(n)
		if diff <= int(b):
			print('YES')
		else:
			print('NO')


def main():
	q = input()
	for i in range(int(q)):
		line = input().split(' ')
		a = int(line[0])
		b = int(line[1])
		n = int(line[2])
		S = int(line[3])
		na = a * n
		qr = S % n
		if na > S:
			if b >= qr:
				print('YES')
			else:
				print('NO')
		elif na == S:
			print('YES')
		elif na + b >= S:
			print('YES')
		else:
			print('NO')
main()


q = int(input())
while q:
	(a, b, n, s) = map(int, input().split())
	d = s // n
	if s - d * n > b:
		print('NO')
		q -= 1
		continue
	b -= s - d * n
	s = d * n
	if s % n == 0 and a * n >= s:
		print('YES')
	elif s - a * n <= b:
		print('YES')
	else:
		print('NO')
	q -= 1


for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if a * c >= d:
		d = d - d // c * c
		if d <= b:
			print('yes'.upper())
		else:
			print('no'.upper())
	else:
		d = d - c * a
		if d <= b:
			print('yes'.upper())
		else:
			print('no'.upper())


def f(l):
	(a, b, n, s) = l
	if s > a * n + b:
		return False
	if n <= b:
		return True
	return s % n <= b
t = int(input())
for _ in range(t):
	l = list(map(int, input().split()))
	print('YES' if f(l) else 'NO')


test = int(input())
for i in range(test):
	value = input().split()
	(a, b, n, s) = value
	a = int(a)
	b = int(b)
	n = int(n)
	s = int(s)
	dvi = s // n
	if dvi <= a:
		laga = dvi * n
		res = s - laga
		if res <= b:
			print('YES')
		else:
			print('NO')
	else:
		laga = a * n
		res = s - laga
		if res <= b:
			print('YES')
		else:
			print('NO')


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from collections import defaultdict as dd
from math import gcd
(t,) = I()
while t:
	t -= 1
	(a, b, n, s) = I()
	if s - min(a * n, s // n * n) <= b:
		print('YES')
	else:
		print('NO')


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	(a, b, n, s) = value()
	n_used = min(a, s // n)
	s -= n_used * n
	if s <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
for j in range(q):
	te = 0
	ke = 0
	(a, b, n, S) = map(int, input().split())
	if a * n <= S:
		S = S - a * n
		if b >= S:
			print('YES')
			continue
		else:
			print('NO')
			continue
	if a * n > S:
		te = S // n
		ke = te * n
		if S - ke <= b:
			print('YES')
			continue
		else:
			print('NO')
			continue


for _ in range(int(input())):
	(a, b, n, s) = [int(i) for i in input().split()]
	nn = s // n
	r = s % n
	if r == 0 and nn <= a:
		print('YES')
	elif r == 0:
		nn = (nn - a) * n
		if nn <= b:
			print('YES')
		else:
			print('NO')
	elif nn <= a and r <= b:
		print('YES')
	elif r > b:
		print('NO')
	else:
		nn = (nn - a) * n
		if r + nn <= b:
			print('YES')
		else:
			print('NO')


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict

def L():
	return list(map(int, stdin.readline().split()))

def Li():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())
P = 1000000007

def xpr(n):
	ans = []
	for i in range(n):
		for j in range(n):
			if i ^ j == n:
				ans.append([i, j])
				return ans

def main():
	try:
		for _ in range(int(input())):
			(a, b, n, s) = Li()
			if n * a <= s:
				s -= n * a
				if s <= b:
					print('YES')
				else:
					print('NO')
			else:
				t1 = s % n
				if t1 <= b:
					print('YES')
				else:
					print('NO')
	except:
		pass
main()


t = int(input())
for i in range(t):
	q = input().split()
	a = int(q[0])
	b = int(q[1])
	n = int(q[2])
	s = int(q[3])
	div = s // n
	rem = s % n
	if a >= div:
		if n * div + b >= s and b >= rem:
			print('YES')
		else:
			print('NO')
	elif n * a + b >= s and b >= rem:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	rem = s % n
	q = s // n
	if a * n + b >= s and b >= rem:
		print('YES')
	else:
		print('NO')


def solve(a, b, n, S):
	(l, r) = (0, a)
	while l <= r:
		mid = (l + r) // 2
		if mid * n == S or (mid * n + b >= S and mid * n < S):
			print('YES')
			return 1
		elif mid * n > S:
			r = mid - 1
		else:
			l = mid + 1
	print('NO')
	return 0
for i in range(int(input())):
	solve(*list(map(lambda i: int(i), input().split())))


import math
for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if a * c + b >= d and d % c <= b:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	info = input().split()
	a_coins = int(info[0])
	b_coins = int(info[1])
	a_value = int(info[2])
	price = int(info[3])
	s1 = price // a_value
	if s1 <= a_coins:
		m = price - s1 * a_value
	else:
		m = price - a_coins * a_value
	if m <= b_coins:
		print('YES')
	else:
		print('NO')


def solve():
	(a, b, n, s) = map(int, input().split())
	k = min(s // n, a)
	if k * n + b >= s:
		print('YES')
	else:
		print('NO')
q = int(input())
while q:
	solve()
	q -= 1


t = int(input())
for i in range(t):
	(a, b, n, S) = map(int, input().split())
	print(('NO', 'YES')[0 <= S % n <= b and a * n >= S - b])


def solve(a, b, n, S):
	div = S // n
	if div > a:
		div = a
	if S - div * n <= b:
		return 'YES'
	else:
		return 'NO'
q = int(input())
for _ in range(q):
	(a, b, n, S) = [int(r) for r in input().split(' ')]
	print(solve(a, b, n, S))


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if s < n:
		if b >= s:
			print('YES')
		else:
			print('NO')
	elif s > n:
		reqn = s // n
		if reqn <= a:
			req1 = s - reqn * n
			if req1 <= b:
				print('YES')
			else:
				print('NO')
		else:
			req1 = s - a * n
			if req1 <= b:
				print('YES')
			else:
				print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	line = input().split()
	a = int(line[0])
	b = int(line[1])
	n = int(line[2])
	S = int(line[3])
	if a * n + b < S:
		print('NO')
		continue
	integ = S // n
	if S - integ * n > b:
		print('NO')
		continue
	else:
		print('YES')


import sys, math, itertools
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush, heapify, nlargest
from copy import deepcopy
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))

def inpl_1():
	return list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))

def inps():
	return sys.stdin.readline()

def inpsl(x):
	tmp = sys.stdin.readline()
	return list(tmp[:x])

def err(x):
	print(x)
	exit()
for _ in range(inp()):
	(a, b, n, s) = inpl()
	A = min(s // n, a)
	s -= A * n
	print('YES' if s <= b else 'NO')


n = int(input())
for i in range(n):
	a = list(map(int, input().split()))
	b = a[3] % a[2]
	c = a[3] // a[2]
	if c > a[0]:
		b = (c - a[0]) * a[2] + b
	if b <= a[1]:
		print('YES')
	else:
		print('NO')


import sys

def alele():
	return list(map(int, sys.stdin.readline().strip().split()))

def ilele():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	(a, b, n, S) = map(int, input().split(' '))
	arq = S // n
	if arq > a:
		arq = a
	if arq * n + b >= S:
		print('YES')
	else:
		print('NO')


from math import gcd, ceil
from collections import defaultdict as dd

def lcm(a, b):
	return a * b // gcd(a, b)

def inin():
	return int(input())

def inar():
	return list(map(int, input().split()))

def ar(element, size):
	return [element for i in range(size)]

def digitsum(num):
	su = 0
	while num:
		su += num % 10
		num //= 10
	return su

def pred(n, k, pointer):
	return pointer - k >= n

def yes():
	print('YES')

def no():
	print('NO')
Testcase = inin()
for n in range(Testcase):
	(a, b, n, s) = inar()
	nrupiyakacoinjayega = min(s // n, a)
	nj = nrupiyakacoinjayega
	if s - nj * n > b:
		no()
	else:
		yes()


print(*map(lambda line: (lambda a, b, n, s: 'YES' if s - min(a, s // n) * n <= b else 'NO')(*line), (map(int, input().split()) for i in range(int(input())))), sep='\n')


l = int(input())
for i in range(l):
	(a, b, n, s) = [int(e) for e in input().strip().split()]
	if a * n + b < s:
		print('NO')
	elif s % n <= b:
		print('YES')
	else:
		print('NO')


n = int(input())
for k in range(n):
	(a, b, n, S) = [int(_) for _ in input().split()]
	a1 = S // n
	if a1 > a:
		S -= a * n
		if S - b <= 0:
			print('YES')
		else:
			print('NO')
	else:
		S -= a1 * n
		if S - b <= 0:
			print('YES')
		else:
			print('NO')


q = int(input())
for qi in range(q):
	(a, b, n, s) = list(map(int, input().split()))
	ac = s // n
	ac = min(a, ac)
	curs = ac * n
	if s - curs <= b:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, S) = map(int, input().split())
	takea = min(a, S // n)
	takeb = min(b, S - takea * n)
	if takeb + takea * n == S:
		print('YES')
	else:
		print('NO')


q = int(input())
res = []
for step in range(q):
	(a, b, n, s) = map(int, input().strip().split(' '))
	res.append('YES' if s >= a * n and s - a * n <= b or (s < a * n and s % n <= b) else 'NO')
print('\n'.join(res))


import sys
input = sys.stdin.readline
read_tuple = lambda _type: map(_type, input().split(' '))

def solve():
	q = int(input())
	for _ in range(q):
		(a, b, n, S) = read_tuple(int)
		tmp = S // n
		if tmp <= a:
			S -= tmp * n
		else:
			S -= n * a
		if b >= S:
			print('YES')
		else:
			print('NO')
solve()


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	if s > a * n + b:
		print('NO')
	elif b >= s:
		print('YES')
	elif s % n == 0 and a >= s // n:
		print('YES')
	else:
		money = s // n
		if a >= money:
			ost = s - money * n
			if b >= ost:
				print('YES')
			else:
				print('NO')
		else:
			ost = s - n * a
			if b >= ost:
				print('YES')
			else:
				print('NO')


q = int(input())
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	if S % n == 0 and a + b // n >= S // n or (S % n != 0 and S < n and (S <= b) or (S % n != 0 and min(a, S // n) * n + b >= S)):
		print('YES')
	else:
		print('NO')


import math
q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split(' '))
	if a * n + b < s:
		print('NO')
	else:
		x = s // n
		y = s - x * n
		if b < y:
			print('NO')
		elif b >= y:
			print('YES')


import sys
q = int(sys.stdin.readline())
for _ in range(q):
	(a, b, n, S) = map(int, sys.stdin.readline().split())
	if S % n == 0:
		if a >= S // n:
			print('YES')
		elif b >= S - a * n:
			print('YES')
		else:
			print('NO')
	elif a > S // n:
		result = S - n * (S // n)
		if result <= b:
			print('YES')
		else:
			print('NO')
	else:
		result = S - a * n
		if result <= b:
			print('YES')
		else:
			print('NO')


number_of_test = int(input())
test_data_list = [input() for x in range(number_of_test)]
for test_data in test_data_list:
	(coins_with_value_n, coins_with_value_1, n_value, required_total) = [int(x) for x in test_data.split()]
	max_number_of_n_coins = required_total // n_value
	coins_n = max_number_of_n_coins if max_number_of_n_coins <= coins_with_value_n else coins_with_value_n
	coins_1 = required_total - coins_n * n_value
	print('YES' if coins_1 <= coins_with_value_1 else 'NO')


q = int(input())
for i in range(q):
	l = [int(x) for x in input().split()]
	a = l[0]
	b = l[1]
	n = l[2]
	s = l[3]
	if s % n + n * max(s // n - a, 0) <= b:
		print('YES')
	else:
		print('NO')


n = int(input())
for _ in range(n):
	numbers = list(map(int, input().split(' ')))
	temp1 = numbers[0] if numbers[-1] // numbers[2] >= numbers[0] else numbers[-1] // numbers[2]
	if temp1 * numbers[2] + numbers[1] >= numbers[-1]:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, n, S) = list(map(int, input().split()))
	(c1, c2) = (S // n <= a and S % n <= b, S // n > a and S - n * a <= b)
	if c1 or c2:
		print('YES')
	else:
		print('NO')


def bSearch(l, h, b, n, s):
	while l <= h:
		mid = l + (h - l) // 2
		if mid * n <= s and s - mid * n <= b:
			return True
		elif mid * n > s:
			h = mid - 1
		else:
			l = mid + 1
tc = int(input())
for _ in range(tc):
	(a, b, n, s) = list(map(int, input().split()))
	mila = 0
	ans = bSearch(0, a, b, n, s)
	if ans:
		print('YES')
	else:
		print('NO')


q = int(input())
res = []
for number in range(q):
	(a, b, n, S) = map(int, input().split())
	t = S // n
	if t > a:
		t = a
	if S - t * n <= b:
		res.append('YES')
	else:
		res.append('NO')
for item in res:
	print(item)


for iter in range(int(input())):
	string = list(map(int, input().split()))
	unit = string[1]
	koef = string[0]
	number = string[2]
	search = string[3]
	if koef * number + unit < search:
		print('NO')
		continue
	else:
		secondkoif = search // number
		if secondkoif > koef:
			secondkoif = koef
		ostatok = search - number * secondkoif
		if ostatok <= unit:
			print('YES')
		else:
			print('NO')


import math

def pwc(a, b, n, S):
	needed_a_coins = S // n
	delta = S - n * min(needed_a_coins, a)
	if delta == 0:
		return 'YES'
	elif delta <= b:
		return 'YES'
	else:
		return 'NO'
	needed_bs = S - needed_as * a
q = input()
q = int(q)
res = [None for i in range(q)]
for i in range(q):
	line = input()
	(a, b, n, S) = [int(i) for i in line.split(' ')]
	res[i] = pwc(a, b, n, S)
for i in range(q):
	print(res[i])


import math
t = int(input())
while t:
	v = input().split(' ')
	a = int(v[0])
	b = int(v[1])
	n = int(v[2])
	s = int(v[3])
	x = min(a, s // n)
	s -= n * x
	if b < s:
		print('NO')
	else:
		print('YES')
	t -= 1


import math
for i in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	print(['NO', 'YES'][min(a, s // n) - max(0, math.ceil((s - b) / n)) + 1 > 0])


from sys import stdin
t = int(stdin.readline())
while t:
	(a, b, n, s) = map(int, stdin.readline().split())
	if b >= s:
		print('YES')
	elif n == 1:
		if a + b >= s:
			print('YES')
		else:
			print('NO')
	else:
		flag = 1
		x = s // n
		if x <= a:
			y = s - n * x
			if y <= b:
				print('YES')
				flag = 0
		else:
			x = a
			y = s - n * x
			if y <= b and x * n + y == s:
				print('YES')
				flag = 0
		if flag:
			y = b
			nx = s - y
			nx = nx - nx % n
			x = nx // n
			if x <= a:
				if x * n + y == s:
					print('YES')
					flag = 0
		if flag:
			print('NO')
	t -= 1


import sys
q = int(input())
for i in range(q):
	(a, b, n, S) = list(map(int, input().split()))
	if a * n + b < S:
		print('NO')
		continue
	j = S // n
	if j * n + b < S:
		print('NO')
		continue
	print('YES')


from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
mod = 10 ** 9 + 7
q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	z = s - min(n * (s // n), n * a)
	if z > b:
		print('NO')
	else:
		print('YES')


q = int(input())
while q > 0:
	q = q - 1
	l = [int(x) for x in input().split()]
	x = l[0] * l[2]
	if x == l[3]:
		print('YES')
	elif x < l[3]:
		if x + l[1] >= l[3]:
			print('YES')
		else:
			print('NO')
	else:
		s = l[3] / l[2]
		r = l[3] % l[2]
		if r <= l[1] and s <= l[0]:
			print('YES')
		else:
			print('NO')


def solution1256a():
	q = int(input())
	for _ in range(q):
		(a, b, n, s) = map(int, input().split())
		quotient = s // n
		if a > quotient:
			a = quotient
		partial_s = a * n + b
		if partial_s >= s:
			print('YES')
		else:
			print('NO')
solution1256a()


t = int(input())
for i in range(t):
	(a, b, n, s) = map(int, input().split())
	if a * n + b < s:
		print('NO')
	else:
		sum_tmp = 0
		tmp = int(s / n)
		tmp = tmp if tmp < a else a
		sum_tmp = tmp * n
		if sum_tmp + b >= s:
			print('YES')
		else:
			print('NO')


t = int(input())
while t:
	t -= 1
	(a, b, n, s) = map(int, input().split())
	if n > 0:
		temp = s // n
		r1 = 0
		r2 = 0
		if temp <= a:
			r2 = s - temp * n
			a1 = a
		elif temp > a:
			a1 = a
			r2 = s - a * n
		if r2 <= b:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	Q = int(input())
	for _ in range(Q):
		(A, B, N, S) = map(int, input().split())
		if A * N + B < S:
			print('NO')
		else:
			an = S // N
			if S - an * N <= B:
				print('YES')
			else:
				print('NO')
main()


q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	temp = a * n
	div = s // n
	if div > a:
		temp = a * n
	else:
		temp = div * n
	if temp < s:
		if s - temp <= b:
			print('YES')
		else:
			print('NO')
	elif temp == s:
		print('YES')


q = int(input())
for i in range(q):
	(a, b, n, S) = list(map(int, input().split()))
	if a * n + b < S:
		print('NO')
	elif S <= b:
		print('YES')
	elif S <= a * n and S % n == 0:
		print('YES')
	elif S < a * n and S % n <= b:
		print('YES')
	elif S > a * n and S - a * n <= b:
		print('YES')
	else:
		print('NO')


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	(a, b, n, s) = rl()
	if a * n + b < s:
		print('NO')
		return
	d = n * (s // n)
	if s - d <= b:
		print('YES')
	else:
		print('NO')
mode = 'T'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


q = int(input())
ans = []
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	x = min(a, S // n)
	ans.append('YES' if x * n + b >= S else 'NO')
print(*ans, sep='\n')


import math
t = int(input())
while t > 0:
	inp = input()
	q = list(map(int, inp.split(' ')))
	a = q[0]
	b = q[1]
	n = q[2]
	S = q[3]
	x = S // n
	if x > a:
		x = a
	if S >= n * x and S <= n * x + b:
		print('YES')
	else:
		print('NO')
	t -= 1


def main(a, b, n, s):
	if a * n + b == s:
		return 'YES'
	elif a * n + b < s:
		return 'NO'
	else:
		c = int(s / n)
		if b >= s - n * c:
			return 'YES'
		else:
			return 'NO'
q = int(input())
for q_itr in range(q):
	abns = list(map(int, input().rstrip().split()))
	a = abns[0]
	b = abns[1]
	n = abns[2]
	s = abns[3]
	res = main(a, b, n, s)
	print(res)


t = int(input())
for cases in range(t):
	(a, b, n, s) = map(int, input().split())
	if a * n + b < s:
		print('NO')
		continue
	else:
		mark = 'NO'
		k = s // n
		h = s - n * k
		if 0 <= h <= b:
			mark = 'YES'
		print(mark)


import math

def main():
	t = int(input())
	for _ in range(t):
		(a, b, n, S) = [int(x) for x in input().split()]
		ca = int(S // n)
		if ca > a:
			ca = a
		if S - ca * n <= b:
			print('YES')
		else:
			print('NO')
main()


n = int(input())
for i in range(0, n):
	m = list(map(int, input().split()))[:4]
	k = m[3] // m[2]
	s = m[3]
	if k <= m[0]:
		d = s - k * m[2]
	else:
		d = s - m[0] * m[2]
	if d <= m[1]:
		print('YES')
	else:
		print('NO')


test_count = int(input())

def check():
	(a, b, n, s) = map(int, input().split())
	summa = a * n + b
	if summa >= s and s % n <= b:
		print('YES')
	else:
		print('NO')
for i in range(test_count):
	check()


q = int(input())
ans = []
for i in range(q):
	(a, b, n, S) = [int(i) for i in input().split()]
	if a * n + b >= S and b >= S % n:
		ans.append('YES')
	else:
		ans.append('NO')
for i in ans:
	print(i)


t = int(input())
while t > 0:
	t = t - 1
	r = False
	(a, b, n, s) = [int(_) for _ in input().split()]
	if s % n <= b and a * n + b >= s:
		print('YES')
	else:
		print('NO')


q = int(input())
res = ''
for t in range(q):
	(a, b, n, s) = [int(x) for x in input().split()]
	p = s // n
	if p > a:
		r = n * (p - a) + s % n
	else:
		r = s % n
	if r > b:
		res = res + 'NO' + '\n'
	else:
		res = res + 'YES' + '\n'
print(res)


import math
q = int(input())
while q > 0:
	(a, b, n, s) = map(int, input().split())
	pro = a * n
	if pro < s:
		if s - b <= pro:
			print('YES')
		else:
			print('NO')
	else:
		k = math.floor(s // n)
		if s - k * n <= b:
			print('YES')
		else:
			print('NO')
	q = q - 1


def int_input():
	return map(int, input().split())
q = int(input())
for i in range(q):
	(a, b, n, S) = int_input()
	o = S % n
	if b < o:
		print('NO')
		continue
	b -= o
	k = S // n
	a += b // n
	if k <= a:
		print('YES')
	else:
		print('NO')


q = int(input())
for _ in range(q):
	(a, b, n, s) = list(map(int, input().split()))
	if a * n == s or b == s or (a * n < s and b >= s - a * n):
		print('YES')
	elif b >= s - n * min(s // n, a):
		print('YES')
	else:
		print('NO')


m = int(input())
for i in range(m):
	(a, b, n, S) = map(int, input().split())
	amount = 0
	if S >= n:
		if S >= n * a:
			if S - n * a > b:
				print('NO')
			else:
				print('YES')
		else:
			amount = S // n
			if S - amount * n <= b:
				print('YES')
			else:
				print('NO')
	elif S <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for p in range(0, t):
	(a, b, n, s) = map(int, input().split())
	di = min(s // n, a)
	di = s - di * n
	if di <= b:
		print('YES')
	else:
		print('NO')


t = int(input())

def solve():
	(a, b, c, d) = map(int, input().split())
	req = d // c
	if req > a:
		d -= c * a
		if d <= b:
			print('YES')
		else:
			print('NO')
	else:
		d -= req * c
		if d <= b:
			print('YES')
		else:
			print('NO')
for i in range(t):
	solve()


def is_able_without_change(a, b, n, s):
	a_ = s // n
	b_ = s % n
	if a_ <= a:
		res = 'YES' if b_ <= b else 'NO'
	else:
		a_lack = a_ - a
		res = 'YES' if a_lack * n + b_ <= b else 'NO'
	return res

def solve():
	q = int(input())
	for _ in range(q):
		(a, b, n, s) = map(int, input().split())
		print(is_able_without_change(a, b, n, s))
solve()


def solve():
	(a, b, n, S) = [int(x) for x in input().split(' ')]
	num_a_required = S // n
	if a < num_a_required:
		leftover = S - a * n
		if b < leftover:
			return 'NO'
		else:
			return 'YES'
	elif a == num_a_required:
		leftover = S - n * num_a_required
		if b < leftover:
			return 'NO'
		else:
			return 'YES'
	else:
		leftover = S - n * num_a_required
		if b < leftover:
			return 'NO'
		else:
			return 'YES'
q = int(input())
for i in range(q):
	ans = solve()
	print(ans)


q = int(input())
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	possible = False
	first = min(S // n, a)
	S -= n * first
	if S == 0 or S <= b:
		possible = True
	if possible:
		print('YES')
	else:
		print('NO')


def main():
	T = int(input())
	for _ in range(T):
		(a, b, n, s) = map(int, input().split())
		m = a * n
		ans = None
		if m <= s:
			rem = s - m
			if rem <= b:
				ans = 'YES'
			else:
				ans = 'NO'
		else:
			mo = s % n
			if mo == 0:
				low = s
			else:
				low = s - mo
			if s - low <= b:
				ans = 'YES'
			else:
				ans = 'NO'
		print(ans)
main()


k = int(input())
for _ in range(k):
	(a, b, n, s) = list(map(int, input().split()))
	s -= min(s // n, a) * n
	if s > b:
		print('NO')
	else:
		print('YES')


from math import ceil, sqrt, floor
import sys
n = int(input())
for i in range(n):
	(a, b, n, s) = map(int, input().split())
	if a * n + b >= s and s % n <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(0, q):
	(a, b, n, S) = map(int, input().split())
	if not a * n + b >= S:
		print('NO')
		continue
	d = S // n
	if a >= d:
		a = d
	if a * n + b >= S:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	m = a * n + b
	flag = 0
	if m >= s:
		if b >= s % n:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


try:
	for _ in range(int(input())):
		(a, b, n, s) = map(int, input().split())
		t = a * n
		if t >= s:
			m = s % n
			if m == 0:
				print('YES')
			elif m <= b:
				print('YES')
			else:
				print('NO')
		else:
			s -= t
			if s <= b:
				print('YES')
			else:
				print('NO')
except:
	pass


from sys import stdin, stdout

def solve():
	(a, b, n, s) = [int(i) for i in stdin.readline().split()]
	if s // n > a:
		if b >= s - a * n:
			return 'YES'
		else:
			return 'NO'
	if s % n > b:
		return 'NO'
	return 'YES'
t = int(input())
for i in range(t):
	print(solve())


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	ans = 0
	if 0 <= s - a * n <= b:
		ans = 1
	temp = s // n
	if s - n * min(a, temp) <= b:
		ans = 1
	if ans != 0:
		print('YES')
	else:
		print('NO')


q = int(input())
arr_0 = []
for i in range(q):
	arr_0 += [[int(i) for i in filter(None, input().split(' '))]]
for i in range(q):
	arr = arr_0[i]
	a = arr[0]
	b = arr[1]
	n = arr[2]
	s = arr[3]
	much = s // n
	s -= n * min(a, much)
	if s <= b:
		ans = 'YES'
	else:
		ans = 'NO'
	print(ans)


import math
from collections import deque, defaultdict
from sys import stdin, stdout
input = stdin.readline
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())
for _ in range(int(input())):
	(a, b, n, s) = mapin()
	rem = s % n
	if rem > b:
		print('NO')
		continue
	b -= rem
	a += b // n
	if s // n <= a:
		print('YES')
	else:
		print('NO')


for __ in range(int(input())):
	(a, b, n, s) = list(map(int, input().split()))
	x = s % n
	if x > b or a * n + b < s:
		print('NO')
	else:
		print('YES')


q = int(input())
while q:
	(a, b, n, s) = map(int, input().split())
	print('YNEOS'[b + min(s // n, a) * n < s::2])
	q -= 1


Q = int(input())
Query = [list(map(int, input().split())) for _ in range(Q)]
for (a, b, n, S) in Query:
	if a * n + b < S:
		ans = 'NO'
	else:
		rem = S - min(S // n, a) * n
		if rem > b:
			ans = 'NO'
		else:
			ans = 'YES'
	print(ans)


t = int(input())
while t:
	t -= 1
	(a, b, n, s) = map(int, input().split())
	print(['NO', 'YES'][max(s % n, s - n * a) <= b])


def main():
	for _ in range(int(input())):
		(a, b, n, s) = map(int, input().split())
		if a * n + b < s:
			print('NO')
		elif b < s % n:
			print('NO')
		else:
			print('YES')
main()


from math import ceil
q = int(input())
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	x = S - a * n
	if x > b:
		print('NO')
		continue
	y = a
	if x < 0:
		e = ceil(-x / n)
		x += e * n
		y -= e
	print('YES' if 0 <= x <= b and 0 <= y <= a else 'NO')


from collections import defaultdict
q = int(input())
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	if n == 1:
		if S > a + b:
			print('NO')
		else:
			print('YES')
		continue
	if S // n > a:
		if S - n * a > b:
			print('NO')
		else:
			print('YES')
	elif S % n > b:
		print('NO')
	else:
		print('YES')


q = int(input())
for i in range(q):
	(a, b, n, S) = list(map(int, input().split()))
	p = a * n
	if p >= S:
		r = S % n
		if r <= b:
			print('YES')
		else:
			print('NO')
	else:
		r = S - p
		if r <= b:
			print('YES')
		else:
			print('NO')


t1 = int(input())
l1 = []
for i in range(t1):
	(a, b, n, s) = map(int, input().split())
	t = 0
	r = 0
	t = s / n
	r = s % n
	flaf = 0
	if t <= a:
		if r <= b:
			flaf = 1
	else:
		v = 0
		v = s - a * n
		if v <= b:
			flaf = 1
	if flaf == 1:
		l1.append('YES')
	else:
		l1.append('NO')
for i in range(t1):
	print(l1[i])


q = int(input())
i = 1
while i <= q:
	[a, b, n, s] = list(map(int, input().split()))
	x = s // n
	y = s % n
	if a >= x and b >= y:
		print('YES')
	elif b < y:
		print('NO')
	elif a < x:
		temp = a * n
		rem = s - temp
		if b >= rem:
			print('YES')
		else:
			print('NO')
	i += 1


n = int(input())
for i in range(n):
	(a, b, v, pay) = map(int, input().split())
	if b >= pay - v * min(a, pay // v):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	b = list(map(int, input().split()))
	if b[0] * b[2] + b[1] < b[3]:
		print('NO')
	elif b[3] % b[2] <= b[1]:
		print('YES')
	else:
		print('NO')


def line():
	return map(int, input().split())

def num():
	return int(input())
from itertools import repeat
q = num()
for _ in repeat(None, q):
	(a, b, n, S) = line()
	print('YES' if a * n + b >= S and b >= S - min(S // n, a) * n else 'NO')


import math

def main():
	tests_count = int(input())
	for _ in range(0, tests_count):
		result = ''
		abns = list(map(int, input().split()))
		a = abns[0]
		b = abns[1]
		n = abns[2]
		s = abns[3]
		if a * n < s:
			if s - a * n <= b:
				result = 'YES'
			else:
				result = 'NO'
		elif a * n == s:
			result = 'YES'
		else:
			leftover = s % n
			if leftover != s:
				s = leftover
			if b >= s:
				result = 'YES'
			else:
				result = 'NO'
		print(result)
main()


for i in range(int(input())):
	(a, b, c, d) = input().split()
	x = int(d) // int(c)
	e = min(x, int(a))
	y = int(d) - e * int(c)
	if int(b) >= y:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
tc = int(input())
for _ in range(tc):
	(a, b, n, s) = list(map(int, input().split()))
	temp = s // n
	if temp <= a:
		temp2 = s - n * temp
		if temp2 <= b:
			print('YES')
		else:
			print('NO')
	elif b + a * n >= s:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(n, b, a, s) = map(int, input().split())
	if a * n + b < s:
		print('NO')
		continue
	k = s / a
	if k >= n:
		print('YES')
	elif s % a <= b:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().strip().split()[:4])
	p = s % n
	if p == 0 and s // n <= a:
		print('YES')
	elif a * n > s:
		k = s // n
		rem = s % n
		if rem <= b:
			print('YES')
		else:
			print('NO')
	elif a * n + b >= s:
		print('YES')
	else:
		print('NO')


n = int(input())
q = ['NO'] * n
for i in range(n):
	(a, b, n, S) = list(map(int, input().split()))
	if b >= S % n and a * n + b >= S:
		q[i] = 'YES'
print(*q, sep='\n')


read = lambda : [int(i) for i in input().split()]
q = int(input())
for _ in range(q):
	(a, b, n, S) = read()
	spend_a = min(a, S // n)
	if S - spend_a * n > b:
		print('NO')
	else:
		print('YES')


t = int(input())
while t > 0:
	(a, b, c, d) = map(int, input().split())
	k = d // c
	if k > a:
		if c * a + b >= d:
			print('YES')
		else:
			print('NO')
	elif k * c + b >= d:
		print('YES')
	else:
		print('NO')
	t -= 1


q = int(input())
numbers = []
for i in range(q):
	x = list(map(int, input().split()))
	numbers.append(x)
for i in range(q):
	x = numbers[i]
	a = x[3] // x[2]
	b = x[3] % x[2]
	if a <= x[0]:
		if b <= x[1]:
			print('YES')
		else:
			print('NO')
	elif a > x[0]:
		c = x[3] - x[2] * x[0]
		if c <= x[1]:
			print('YES')
		else:
			print('NO')


n = int(input())
for i in range(0, n, 1):
	(a, b, c, d) = map(int, input().split())
	k = int(min(d / c, a))
	d -= k * c
	if d > b:
		print('NO')
	else:
		print('YES')


q = int(input())
while q:
	(a, b, n, S) = map(int, input().split())
	if n * a == S:
		print('YES')
	elif n * a < S:
		z = S - n * a
		if z <= b:
			print('YES')
		else:
			print('NO')
	else:
		z = S // n
		diff = S - z * n
		if diff <= b:
			print('YES')
		else:
			print('NO')
	q = q - 1


rr = lambda : input().strip()
rri = lambda : int(rr())
rrm = lambda : [int(x) for x in rr().split()]

def sol():
	(a, b, n, s) = rrm()
	x = s // n
	if x > a and x != 0:
		if s - a * n > b:
			return 'NO'
		return 'YES'
	s %= n
	if s > b and s != 0:
		return 'NO'
	return 'YES'
T = rri()
for _ in range(T):
	ans = sol()
	print(ans)


from sys import stdin, stdout
n = stdin.readline()
q = int(n)
while q:
	(a, b, n, s) = [int(x) for x in stdin.readline().rstrip().split()]
	if a >= (s - s % n) / n:
		s = s - (s - s % n) / n * n
	else:
		s = s - n * a
	if b >= s:
		s = 0
	if s == 0:
		print('YES')
	else:
		print('NO')
	q = q - 1


N = int(input())
for _ in range(N):
	(a, b, n, s) = map(int, input().split())
	r = s % n
	k = s // n
	if r > b:
		print('NO')
	else:
		b = b - r
		if k > a:
			k = k - a
			if b >= k * n:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')


testCases = int(input())
for i in range(0, testCases):
	(a, b, n, S) = map(int, input().split())
	tot = S
	if n != 0:
		numberOfN = tot // n
		if numberOfN <= a:
			tot -= numberOfN * n
		else:
			tot -= a * n
	if tot <= b:
		tot = 0
	if tot == 0:
		print('YES')
	else:
		print('NO')


import sys
import math
import itertools
import collections

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base=3):
	newnumber = ''
	while number > 0:
		newnumber = str(number % base) + newnumber
		number //= base
	return newnumber
t = ii()
for _ in range(t):
	(a, b, n, s) = mi()
	if a * n + b >= s and s % n <= b:
		print('YES')
	else:
		print('NO')


for case in range(int(input())):
	(a, b, n, s) = list(map(int, input().split()))
	rem = s - min(s // n, a) * n
	print('YES' if rem <= b else 'NO')


import sys
import math

def main():
	for _ in range(int(input())):
		(a, b, n, s) = [int(x) for x in sys.stdin.readline().split()]
		if a * n + b < s:
			print('NO')
		else:
			x = s // n
			s = s - n * x
			if s <= b:
				print('YES')
			else:
				print('NO')
main()


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	need_a = s // n
	need_b = s % n
	if need_a <= a and need_b <= b or 0 < s - a * n <= b:
		ans = 'YES'
	else:
		ans = 'NO'
	print(ans)


import sys, math, queue, collections
MOD = 10 ** 9 + 7
for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	s -= n * min(a, s // n)
	if s <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
while q > 0:
	q -= 1
	(a, b, n, s) = list(map(int, input().split()))
	x = min(int(s / n), a)
	y = min(b, s - x * n)
	if y + x * n == s:
		print('YES')
	else:
		print('NO')


q = int(input())
for qq in range(q):
	(a, b, n, s) = map(int, input().split())
	n_count = s / n
	count_1 = s % n
	poss_a = 0
	poss_b = 0
	if n_count > a:
		poss_a = a
	else:
		poss_a = n_count
	if count_1 > b:
		poss_b = b
	else:
		poss_b = count_1
	if s - poss_a * n <= b and count_1 <= b:
		print('YES')
	else:
		print('NO')


from math import *
from collections import *
t = int(input())
for y in range(t):
	a = list(map(int, input().split()))
	x = a[3] // a[2]
	a[3] -= min(x, a[0]) * a[2]
	if a[3] <= a[1]:
		print('YES')
	else:
		print('NO')


from __future__ import print_function
import sys

def read_a_integer():
	return int(input())

def read_a_list(dtype):
	return list(map(dtype, input().split()))

def main():
	q = read_a_integer()
	for _ in range(q):
		(a, b, n, S) = read_a_list(int)
		enough_b = S - min(S // n, a) * n <= b
		if enough_b:
			print('YES')
		else:
			print('NO')
main()


q = int(input())
for i in range(q):
	(a, b, n, S) = [int(j) for j in input().split(' ')]
	if a * n + b < S:
		print('NO')
		continue
	mod = S % n
	if mod > b:
		print('NO')
		continue
	print('YES')


import sys
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if a * n + b >= s:
		if s % n <= b:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


n = int(input())
for test_cases in range(n):
	(a, b, n, S) = list(map(int, input().split()))
	if S // n <= a and S % n <= b:
		print('YES')
	elif S // n > a and S - a * n <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b, n, s) = input().split()
	k = 0
	a = int(a)
	b = int(b)
	n = int(n)
	s = int(s)
	c = s % n
	if c <= b and a * n + b >= s:
		print('YES')
	else:
		print('NO')


import sys
input = lambda : sys.stdin.readline().rstrip()
q = int(input())
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	use_a = S // n
	if use_a > a:
		change_a = S - n * a
	else:
		change_a = S % n
	if change_a > b:
		print('NO')
	else:
		print('YES')


def ispossible(a, b, n, S):
	if S // n <= a:
		if S % n <= b:
			return True
		else:
			return False
	elif S - a * n <= b:
		return True
	else:
		return False
for _ in range(int(input())):
	(a, b, n, S) = tuple(map(int, input().split()))
	if ispossible(a, b, n, S):
		print('YES')
	else:
		print('NO')


def fun_c(a, b, n, S):
	min = (S - b) / n
	max = S / n
	t = max // 1
	if max <= a:
		if t >= min:
			print('YES')
		else:
			print('NO')
	elif a >= min:
		print('YES')
	else:
		print('NO')
q = int(input())
for i in range(q):
	l = list(map(int, input().split()))
	a = l[0]
	b = l[1]
	n = l[2]
	S = l[3]
	sm = (S - b) / n
	bg = S / n
	t = bg // 1
	if bg <= a:
		if t >= sm:
			print('YES')
		else:
			print('NO')
	elif a >= sm:
		print('YES')
	else:
		print('NO')


t = int(input())
i = 0
while i < t:
	(a, b, n, s) = map(int, input().split())
	if a * n + b >= s:
		aa = s // n
		bb = s % n
		if aa > a:
			bb = (aa - a) * n
			aa = a
		if bb <= b:
			print('YES')
		elif b >= s:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	i += 1


def F(a, b, n, S):
	if b + 1 > n:
		if (S - b) % n == 0:
			if (S - b) // n <= a:
				return 'YES'
			else:
				return 'NO'
		elif a >= (S - b) // n + 1:
			return 'YES'
		else:
			return 'NO'
	else:
		if (S - b) % n == 0 and (S - b) // n <= a:
			return 'YES'
		if S % n == 0 and S // n <= a:
			return 'YES'
		elif (S - b) // n == S // n:
			return 'NO'
		elif S // n <= a:
			return 'YES'
		else:
			return 'NO'
for i in range(int(input())):
	(a, b, n, S) = list(map(int, input().split()))
	print(F(a, b, n, S))


import math
test = int(input())
result = []
for i in range(test):
	(a, b, n, s) = list(map(int, input().split()))
	x = math.floor(s / n)
	y = s % n
	if a >= x and b >= y:
		result.append('YES')
	elif a >= x and b < y:
		result.append('NO')
	elif a < x and b < y:
		result.append('NO')
	elif a < x and b >= y:
		diff = (x - a) * n + y
		if b >= diff:
			result.append('YES')
		else:
			result.append('NO')
for i in range(test):
	print(result[i])


q = int(input())
cout = ''
for i in range(q):
	st = input().split()
	if int(st[0]) * int(st[2]) + int(st[1]) < int(st[3]):
		cout += 'NO'
	elif int(st[3]) // int(st[2]) <= int(st[0]) and int(st[3]) % int(st[2]) <= int(st[1]) or (int(st[3]) // int(st[2]) > int(st[0]) and int(st[1]) >= int(st[3]) - int(st[0]) * int(st[2])):
		cout += 'YES'
	else:
		cout += 'NO'
	cout += '\n'
print(cout)


t = int(input())
for _ in range(t):
	(a, b, n, s) = [int(i) for i in input().split()]
	x1 = min(a, s // n)
	t1 = s - n * x1
	if t1 <= b:
		print('YES')
	else:
		print('NO')


from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
mod = 10 ** 9 + 7
eps = 10 ** (-7)

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))

def inpl_str():
	return list(sys.stdin.readline().split())
Q = inp()
for _ in range(Q):
	(a, b, n, S) = inpl()
	if a * n + b * 1 < S:
		print('NO')
	else:
		x = min(S // n, a)
		if S - x * n <= b:
			print('YES')
		else:
			print('NO')


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	if n > b:
		y = s % n
		x = (s - y) // n
		if x >= 0 and x <= a and (y >= 0) and (y <= b):
			answer = True
		else:
			answer = False
	elif s <= a * n + b:
		answer = True
	else:
		answer = False
	if answer:
		print('YES')
	else:
		print('NO')


def li():
	return [int(i) for i in input().rstrip('\n').split(' ')]

def st():
	return input().rstrip('\n')
for _ in range(int(input())):
	(a, b, n, s) = li()
	s -= b
	ans = 'NO'
	if a * n < s:
		print(ans)
		continue
	elif s <= 0:
		print('YES')
	elif n <= s + b and (s + b >= (s // n + 1) * n or s // n * n == s):
		print('YES')
	else:
		print(ans)


n = input()
lines = []
for i in range(int(n)):
	line = input().split()
	s = int(line[0]) * int(line[2])
	if int(line[3]) == s:
		print('YES')
	elif int(line[3]) > s:
		if int(line[3]) - s > int(line[1]):
			print('NO')
		else:
			print('YES')
	elif int(line[3]) % int(line[2]) > int(line[1]):
		print('NO')
	else:
		print('YES')


q = int(input())
for _ in range(q):
	(a, b, n, s) = input().split()
	a = int(a)
	b = int(b)
	n = int(n)
	s = int(s)
	ans = s // n
	if ans >= a:
		s -= a * n
	else:
		s -= ans * n
	if s <= b:
		print('YES')
	else:
		print('NO')


n = int(input())
l = []
for i in range(n):
	l2 = []
	s = input()
	l1 = s.split(' ')
	l.append(l1)
for k in range(n):
	for j in range(len(l[k])):
		l[k][j] = int(l[k][j])
for i in range(n):
	f = 0
	if l[i][0] * l[i][2] + l[i][1] < l[i][3]:
		print('NO')
	elif l[i][0] * l[i][2] < l[i][3]:
		print('YES')
	elif l[i][1] < l[i][3] % l[i][2]:
		print('NO')
	else:
		print('YES')


t = int(input())
while t > 0:
	t -= 1
	(a, b, n, s) = map(int, input().split())
	total = a * n + b
	if total < s:
		print('NO')
	elif total == s:
		print('YES')
	elif a * n <= s:
		print('YES')
	else:
		z = s % n
		if z <= b:
			print('YES')
		else:
			print('NO')


for l in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	if a * n == s:
		print('YES')
	elif a * n < s:
		if s - a * n <= b:
			print('YES')
		else:
			print('NO')
	else:
		k = s // n
		p = k * n
		q = s - p
		if q <= b:
			print('YES')
		else:
			print('NO')


from sys import stdin
t = int(stdin.readline().rstrip())
while t > 0:
	(a, b, n, s) = map(int, stdin.readline().split())
	p = a
	if s >= n:
		s -= min(s - s % n, a * n)
	if s == 0:
		print('YES')
	elif s <= b:
		print('YES')
	else:
		print('NO')
	t -= 1


import sys
readline = sys.stdin.readline
rdw = lambda : readline().rstrip()
rdws = lambda : readline().split()
rdwl = lambda : list(readline().split())
rdi = lambda : int(readline())
rdis = lambda : map(int, readline().split())
rdil = lambda : list(map(int, readline().split()))
rdilrows = lambda cnt: [rdil() for _ in range(cnt)]

def solve():
	(a, b, n, S) = rdis()
	res = b >= S
	if not res:
		Smin = S - b
		x = (Smin + n - 1) // n
		if x <= a and x * n <= S:
			res = True
	print('YES' if res else 'NO')
tests = 1
tests = rdi()
for testnum in range(tests):
	solve()


for _ in range(int(input())):
	(a, b, n, s) = [int(i) for i in input().split()]
	if a * n + b < s:
		print('NO')
	else:
		mod = s // n
		if mod > a:
			if s - a * n > b:
				print('NO')
			else:
				print('YES')
		else:
			num = s - mod * n
			if num > b:
				print('NO')
			else:
				print('YES')


for _ in range(int(input())):
	(a, b, n, S) = map(int, input().split())
	ans = 'YES'
	cel = S // n
	if cel <= a:
		if S % n > b:
			ans = 'NO'
	else:
		ost = S - a * n
		if ost > b:
			ans = 'NO'
	print(ans)


q = int(input())
for _ in range(q):
	l1 = [int(x) for x in input().split()]
	(a, b, n, S) = (l1[0], l1[1], l1[2], l1[3])
	if a * n + b < S:
		print('NO')
	elif S % n > b:
		print('NO')
	else:
		print('YES')


T = int(input())
for i in range(T):
	(a, b, n, S) = map(int, input().split())
	if a * n + b < S:
		print('NO')
	elif a * n + b == S:
		print('YES')
	else:
		d = min(S // n, a)
		ans1 = S - d * n
		if ans1 <= b:
			print('YES')
		else:
			print('NO')


q = int(input())
for it in range(q):
	(a, b, n, s) = [int(e) for e in input().split(' ')]
	if s - a * n <= b and s % n <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(a, b, c, d) = [int(x) for x in input().split()]
	k = a * c + b
	if k < d or d % c > b:
		print('NO')
	else:
		print('YES')


t = int(input())
l = []
for i in range(t):
	e = [int(e) for e in input().split()]
	l.append(e)
for j in range(len(l)):
	rem = l[j][3] % l[j][2]
	if (l[j][0] * l[j][2] + l[j][1] > l[j][3] or l[j][0] * l[j][2] + l[j][1] == l[j][3]) and (rem < l[j][1] or rem == l[j][1]):
		print('YES')
	else:
		print('NO')


t = int(input())
for tests in range(t):
	(a, b, n, s) = list(map(int, input().split()))
	k = s // n
	if k <= a:
		j = s % n
		if j <= b:
			print('YES')
		else:
			print('NO')
	elif b >= s - a * n:
		print('YES')
	else:
		print('NO')


import math
import copy
t = int(input())
for _ in range(t):
	(a, b, n, s) = [int(i) for i in input().split()]
	a1 = int(s / n)
	x = -1
	if a >= a1:
		b1 = s % n
		if b >= b1:
			x = 0
	else:
		b1 = s - a * n
		if b >= b1:
			x = 0
	if x == 0:
		print('YES')
	else:
		print('NO')


o = int(input())
for i in range(o):
	isYes = False
	(a, b, n, s) = list(map(int, input().split(' ')))
	if n < s:
		cnN = s // n
		if cnN <= a:
			if cnN * n + b >= s:
				isYes = True
		elif a * n + b >= s:
			isYes = True
	elif n == s:
		isYes = True
	elif b >= s:
		isYes = True
	if isYes:
		print('YES')
	else:
		print('NO')


def test_case(a, b, n, s):
	if s < a * n:
		a = s // n
	if s - a * n <= b:
		print('YES')
	else:
		print('NO')
test_cases_num = int(input())
for i in range(test_cases_num):
	(a, b, n, s) = list(map(int, input().split()))
	test_case(a, b, n, s)


for i in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	k = s % n
	y = a * n + b
	if b >= k and y >= s:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, n, s) = map(int, input().split(' '))
	if b >= s % n and a >= s // n or b >= s or (s % n == 0 and a >= s // n) or (a * n <= s and b >= s - n * a):
		print('YES')
	else:
		print('NO')


testcase = int(input())
queries = []
for _ in range(testcase):
	queries.append(list(map(int, input().strip().split())))
for i in range(testcase):
	a = queries[i][0]
	b = queries[i][1]
	n = queries[i][2]
	S = queries[i][3]
	if max(S - a * n, S % n) <= b:
		print('YES', end='\n')
	else:
		print('NO', end='\n')


from sys import stdin
read = stdin.readline

def solve(a, b, n, S):
	coins = S // n
	if coins > a:
		coins = a
	res = S - coins * n
	return b >= res

def main():
	n = int(read().strip())
	for i in range(n):
		(a, b, n, S) = map(int, read().strip().split())
		print('YES' if solve(a, b, n, S) else 'NO')
main()


t = int(input())
while t:
	t -= 1
	(a, b, n, s) = map(int, input().split())
	k = a * n
	if k == s:
		print('YES')
		continue
	if k < s:
		k += b
		if k >= s:
			print('YES')
			continue
		else:
			print('NO')
			continue
	if k > s:
		m = s // n
		k = m * n
		k += b
		if k >= s:
			print('YES')
			continue
		else:
			print('NO')


q = int(input())
result = []
for i in range(q):
	(a, b, n, s) = list(map(int, input().split()))
	x = s // n
	if x > a:
		x = a
	y = s - x * n
	if y > b:
		result.append('NO')
	else:
		result.append('YES')
for i in range(q):
	print(result[i])


q = int(input())
for i in range(q):
	x = [int(x) for x in input().split()]
	a = x[0]
	b = x[1]
	n = x[2]
	S = x[3]
	if S / n <= a and S % n == 0:
		print('YES')
	elif S / n <= a and S % n > 0:
		if S % n <= b:
			print('YES')
		else:
			print('NO')
	elif S / n > a:
		S -= a * n
		if S <= b:
			print('YES')
		else:
			print('NO')


T = int(input())
for i in range(T):
	arr = list(map(int, input().split()))
	a = arr[0]
	b = arr[1]
	n = arr[2]
	S = arr[3]
	if S % n == 0:
		if S // n <= a:
			print('YES')
		elif S - a * n <= b:
			print('YES')
		else:
			print('NO')
	elif S % n > 0:
		if S // n <= a:
			if S % n <= b:
				print('YES')
			else:
				print('NO')
		elif S // n > a:
			if S - a * n <= b:
				print('YES')
			else:
				print('NO')


import sys
numCases = int(sys.stdin.readline())
for _ in range(numCases):
	(numMon_a, numMon_b, value_a, sum_total) = [int(i) for i in sys.stdin.readline().strip().split(' ')]
	print('YNEOS'[numMon_a * value_a + numMon_b < sum_total or sum_total % value_a > numMon_b::2])


from math import gcd
q = int(input())
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	if a * n + b * 1 < S:
		print('NO')
	elif a * n + b * 1 == S:
		print('YES')
	else:
		aux = S // n
		S -= min(n * aux, a * n)
		if b >= S:
			print('YES')
		else:
			print('NO')


t = int(input())
for _ in range(t):
	(a, b, n, s) = map(int, input().split())
	if b >= s:
		print('YES')
	elif s % n == 0 and n <= s:
		if a >= s // n:
			print('YES')
		else:
			temp = s - a * n
			if b >= temp:
				print('YES')
			else:
				print('NO')
	elif s % n != 0 and n <= s:
		if a >= s // n:
			if b >= s % n:
				print('YES')
			else:
				print('NO')
		else:
			temp = s - a * n
			if b >= temp:
				print('YES')
			else:
				print('NO')
	else:
		print('NO')


import math
t = int(input())
for i in range(t):
	(A, B, N, S) = input().split()
	a = int(A)
	b = int(B)
	n = int(N)
	s = int(S)
	if a * n < s:
		if b < s - a * n:
			print('NO')
		else:
			print('YES')
	elif a * n == s:
		print('YES')
	else:
		x = math.floor(s / n)
		y = x * n
		if b < s - y:
			print('NO')
		else:
			print('YES')


import math

def solve():
	(a, b, n, s) = map(int, input().split())
	temp = a * n
	if temp >= s:
		rem = s % n
		if rem <= b:
			print('YES')
		else:
			print('NO')
	else:
		rem = s - a * n
		if rem <= b:
			print('YES')
		else:
			print('NO')
	return
t = int(input())
while t:
	solve()
	t -= 1


from math import floor
q = int(input())
for _ in range(q):
	(a, b, n, s) = map(int, input().split())
	s -= n * min(floor(s // n), a)
	if s <= b:
		print('YES')
	else:
		print('NO')


t = int(input())
for j in range(t):
	(a, b, n, s) = map(int, input().split(' '))
	p = s // n
	if p <= a and s - p * n <= b:
		print('YES')
	elif p > a:
		if s - n * a <= b:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


from sys import stdin
for _ in range(int(stdin.readline())):
	(a, b, n, s) = list(map(int, stdin.readline().split()))
	(c, d) = divmod(s, n)
	e = max((c - a) * n, 0)
	if e + d <= b:
		print('YES')
	else:
		print('NO')


q = int(input())
for tc in range(q):
	data = input().split(' ')
	(a, b, n, S) = (int(data[0]), int(data[1]), int(data[2]), int(data[3]))
	x = S // n
	if a < x:
		x = a
	if x * n + b < S:
		print('NO')
	else:
		print('YES')


import sys
reader = (line.rstrip() for line in sys.stdin)
input = reader.__next__
q = int(input())
for _ in range(q):
	(a, b, n, S) = map(int, input().split())
	if a * n >= S:
		print('YES' if S % n <= b else 'NO')
	else:
		print('YES' if S - n * a <= b else 'NO')


def main():
	(a, b, n, S) = map(int, input().split())
	if n < S and b < S - n * min(a, S // n) or (n > S and b < S):
		print('NO')
	else:
		print('YES')
t = int(input())
while t:
	main()
	t -= 1


def can_have_exact_change(a, b, coin_value, desired_sum):
	with_higher = a * coin_value
	higher_in_desired = desired_sum // coin_value
	ammount_with_higher = higher_in_desired * coin_value if with_higher >= desired_sum else with_higher
	left_from_desired = desired_sum - ammount_with_higher
	return left_from_desired <= b
number_of_tests = int(input())
for _ in range(number_of_tests):
	(a, b, coin_value, desired_sum) = [int(x) for x in input().split()]
	result = 'YES' if can_have_exact_change(a, b, coin_value, desired_sum) else 'NO'
	print(result)


for _ in range(int(input())):
	(a, b, n, s) = list(map(int, input().split()))
	r = s - n * min(a, s // n) - b
	print('YNEOS'[r > 0::2])


l = []
a = int(input())
for i in range(a):
	(a, b, n, s) = tuple(map(int, input().split()))
	if b >= s:
		l.append('YES')
	elif n > s:
		if b == s:
			l.append('YES')
		else:
			l.append('NO')
	elif n < s:
		r = s // n
		c = r * n
		d = c + b
		if r <= a and d >= s:
			l.append('YES')
		elif r > a:
			if b == s:
				l.append('YES')
			elif b + a * n >= s:
				l.append('YES')
			else:
				l.append('NO')
		else:
			l.append('NO')
	else:
		l.append('YES')
for i in l:
	print(i)


q = int(input())
for i in range(q):
	a = list(map(int, input().split(' ')))
	if a[3] > a[0] * a[2] + a[1]:
		print('NO')
		continue
	a[3] -= min(a[0], int(a[3] / a[2])) * a[2]
	if a[3] <= a[1]:
		print('YES')
	else:
		print('NO')


for z in range(int(input())):
	(a, b, n, s) = map(int, input().split())
	ans = 0
	ans += min(a, s // n) * n
	s -= ans
	if s <= b:
		print('YES')
	else:
		print('NO')


I = lambda : int(input())
ID = lambda : map(int, input().split())
IL = lambda : list(ID())
q = I()
for i in range(q):
	(a, b, n, s) = ID()
	k = s // n
	if k > a:
		k = a
	if k * n + b >= s:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	(a, b, n, S) = map(int, input().split())
	if n * a + b >= S:
		y = min(a, int(S / n))
		s = y * n
		if b >= S - s:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


import math
n = int(input())
for _ in range(n):
	(a, b, n, s) = map(int, input().split())
	(left, right) = (s - b, s)
	x = math.ceil(left / n)
	if left <= x * n <= right and x <= a:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	x = [int(x) for x in input().split()]
	if x[3] % x[2] <= x[1] and x[0] * x[2] + x[1] >= x[3]:
		print('YES')
	else:
		print('NO')


trail = int(input())
for i in range(trail):
	data = input()
	datas = data.split()
	value = [int(a) for a in datas]
	product = value[0] * value[2]
	if product == value[3]:
		print('YES')
	elif product < value[3]:
		dif = value[3] - product
		if value[1] >= dif:
			print('YES')
		else:
			print('NO')
	else:
		remainder = value[3] % value[2]
		if value[1] >= remainder:
			print('YES')
		else:
			print('NO')


queries = int(input())
for x in range(queries):
	nums = input().split()
	nums = (x for x in nums)
	(a, b, n, s) = nums
	m = int(s) // int(n)
	if int(a) <= m:
		least = int(a) * int(n)
	else:
		least = int(n) * m
	if int(a) * int(n) + int(b) < int(s):
		print('NO')
		continue
	elif least == int(s):
		print('YES')
		continue
	elif least + int(b) >= int(s):
		print('YES')
		continue
	else:
		print('NO')


q = int(input())
for _ in range(q):
	(acn, bc1, n, s) = map(int, input().split())
	if s % n <= bc1 and acn * n + bc1 >= s:
		print('YES')
	else:
		print('NO')


q = int(input())
for i in range(q):
	(a, b, n, s) = map(int, input().split())
	if a * n + b < s:
		print('NO')
	else:
		quot = s // n
		rem = s % n
		if b - max(quot - a, 0) * n >= rem:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	(a, b, n, S) = list(map(int, input().split(' ')))
	if S % n > b:
		print('NO')
		continue
	nS = S - S % n
	b -= S % n
	if nS > a * n + b:
		print('NO')
		continue
	print('YES')


q = int(input())
c = 0
while c < q:
	(a, b, n, S) = [int(i) for i in input().split()]
	a = min(S // n, a)
	if a * n + b >= S:
		print('YES')
	else:
		print('NO')
	c += 1