#K54067. Even Distribution of Marbles
Even Distribution of Marbles
Even Distribution of Marbles
You are given a number of marbles M and jars J. The task is to determine whether it is possible to distribute all M marbles evenly among the J jars. In mathematical terms, you need to check if \( M \mod J = 0 \). If the condition holds, print YES, otherwise print NO.
Note: Each jar must receive the same number of marbles, and there should be no marble left over.
inputFormat
The input is given via standard input (stdin) and is structured as follows:
- The first line contains a single integer T, representing the number of test cases.
- Each of the following T lines contains two space-separated integers M and J, where M represents the number of marbles and J represents the number of jars.
outputFormat
For each test case, output a single line containing YES if the marbles can be evenly distributed among the jars, and NO otherwise.
## sample3
10 2
15 4
100 5
YES
NO
YES
</p>