PROBLEM LINK:
Author: sid_rasa
Tester: akay_99
Editorialist: sid_rasa
DIFFICULTY:
EASY
PREREQUISITES:
Math
PROBLEM:
Given a health M, check if it is a multiple of health N.
QUICK EXPLANATION:
Check if the remainder is 0.
EXPLANATION:
A number is a multiple of other number if it is completely divisible i.e, when divided it produces a remainder zero. The modulo operation β%β is used here to calculate the remainder.
TIME COMPLEXITY
O(1) i.e, constant time as the time taken doesnβt depend upon the input.
SOLUTIONS:
Setter's Solution
#include <iostream>
using namespace std;
int main()
{
int testCases;
cin >> testCases;
while (testCases--)
{
int N, M;
cin >> N >> M;
if (M % N == 0)
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl;
}
}
}
Tester's Solution
`for i in range(int(input())):
a,b=map(int,input().split())
ans= 'YES' if b%a==0 else 'NO'
print(ans)`