#K64782. Equal Cookie Distribution
Equal Cookie Distribution
Equal Cookie Distribution
You are given a number of cookies, \(M\), and a number of customers, \(N\). Your task is to determine if it is possible to distribute all \(M\) cookies equally among the \(N\) customers. In other words, check if \(M\) is divisible by \(N\), i.e. \(M \bmod N = 0\).
The input consists of multiple test cases. For every test case, output YES
if \(M\) cookies can be equally distributed among \(N\) customers, otherwise output NO
.
inputFormat
Input is read from standard input. The first line contains an integer \(T\) denoting the number of test cases. Each of the following \(T\) lines contains two space-separated integers \(M\) and \(N\), where \(M\) is the number of cookies and \(N\) is the number of customers.
outputFormat
For each test case, output a single line containing YES
if \(M\) can be equally distributed among \(N\) customers (i.e. if \(M \bmod N = 0\)), otherwise output NO
.
2
6 3
8 3
YES
NO
</p>