In a test, there are N problems, each carrying X marks.  
In each problem, Chef either received X marks or 0 marks.

Determine whether is it possible for Chef to achieve exactly Y marks.

------ Input Format ------ 

- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of three integers N, X, and Y, the number of problems, the maximum score for each problem, and the score Chef wants.

------ Output Format ------ 

For each test case, output YES if Chef can achieve exactly Y marks, NO otherwise.

You can print each character of the string in uppercase or lowercase. For example, the strings Yes, YES, yes, and yEs, are all considered identical.

------ Constraints ------ 

$1 ≤ T ≤ 100$
$1 ≤ N ≤ 10$
$1 ≤ X ≤ 10$
$0 ≤ Y ≤ N \cdot X$

----- Sample Input 1 ------ 
5
1 8 4
3 6 12
4 5 0
10 10 100
8 5 36

----- Sample Output 1 ------ 
NO
YES
YES
YES
NO

----- explanation 1 ------ 
Test case $1$: There is no way for Chef to score exactly $4$ marks.

Test case $2$: Chef can score $12$ marks by receiving $6$ marks in $2$ problems and $0$ marks in $1$ problem.

Test case $3$: Chef can score $0$ marks by receiving $0$ marks in each of the $4$ problems.

Test case $4$: Chef can score $100$ marks by receiving $10$ marks in each of the $10$ problems.

Test case $5$: There is no way for Chef to score exactly $36$ marks.

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	if c % b == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(N, X, Y) = map(int, input().split())
	count = 0
	for i in range(N + 1):
		if i * X == Y:
			count += 1
	if count > 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	(n, x, y) = map(int, input().split())
	print('YES' if y == 0 or y % x == 0 else 'NO')
	t -= 1


t = int(input())
for u in range(t):
	(N, X, Y) = list(map(int, input().split()))
	if Y == 0:
		print('YES')
	elif Y % X == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, x, y) = map(int, input().split())
	print('YES') if y % x == 0 else print('NO')


f = int(input())
for i in range(f):
	(m, a, b) = map(int, input().split())
	print('YES') if b % a == 0 else print('NO')


t = int(input())
for i in range(t):
	(n, x, y) = map(int, input().split())
	j = 1
	sum = 0
	if y == 0:
		print('YES')
	else:
		while j <= n:
			sum = sum + x
			if sum == y:
				print('YES')
				break
			j = j + 1
		if sum != y:
			print('NO')


for _ in range(int(input())):
	(x, y, z) = map(int, input().split())
	a = x * y
	if z % y == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	if c % b == 0:
		print('YES')
	elif c == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	flag = 0
	(n, x, y) = list(map(int, input().split()))
	for i in range(1, n + 1):
		val = i * x
		if y % val == 0:
			flag = 1
			print('YES')
			break
	if flag == 0:
		print('NO')


f = int(input())
for i in range(f):
	count = 0
	(n, x, y) = map(int, input().split())
	for i in range(n + 1):
		if i * x == y:
			count = 1
			break
	if count == 1:
		print('YES')
	else:
		print('NO')


T = int(input())
for i in range(T):
	(N, X, Y) = map(int, input().split())
	if Y % X == 0:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	(n, x, y) = map(int, input().split())
	if y == 0:
		print('YES')
	elif x > y:
		print('NO')
	elif y % x == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(n, m, z) = map(int, input().split())
	if z % m == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(x, y, z) = map(int, input().split())
	if z % y == 0:
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	(N, X, Y) = map(int, input().split())
	if Y == 0 or Y % X == 0:
		print('YES')
	elif N * X <= Y:
		print('YES')
	else:
		print('NO')


def ask_for_numbers():
	text = input()
	return list(map(int, text.split()))

def results(nums):
	for i in range(nums[0] + 1):
		if nums[1] * i == nums[2]:
			return 'YES'
	return 'NO'

def main():
	tests = int(input())
	for _ in range(tests):
		nums = ask_for_numbers()
		print(results(nums))
main()


t = int(input())
for i in range(t):
	c = input()
	v = c.split(' ')
	x = int(v[0])
	y = int(v[1])
	w = int(v[2])
	b = 'NO'
	for i in range(x + 1):
		if y * i == w:
			b = 'YES'
			break
	print(b)


a = int(input())
for s in range(a):
	(n, x, y) = map(int, input().split())
	for b in range(n + 1):
		if b * x == y:
			print('YES')
			break
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(problems, score_per_problem, desired_score) = map(int, input().split())
	if desired_score % score_per_problem == 0 and problems * score_per_problem >= desired_score:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, x, y) = map(int, input().split())
	ans = 'YES' if y % x == 0 else 'NO'
	print(ans)