Skip to content

Instantly share code, notes, and snippets.

@SpikeVN
Last active October 10, 2023 15:21
Show Gist options
  • Save SpikeVN/517fd202ac538306e2c7812f02b7b529 to your computer and use it in GitHub Desktop.
Save SpikeVN/517fd202ac538306e2c7812f02b7b529 to your computer and use it in GitHub Desktop.
n = int(input())
data = []
for _ in range(n):
l = [int(i) for i in input().split()]
next_line = False
for na in range(1, l[0] + 1):
for nb in range(1, l[1] + 1):
if na * l[2] + nb * 1 == l[3]:
next_line = True
print("YES")
break
if next_line:
break
else:
print("NO")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment