Dcoder icon

Buy The Bundle @ Dcoder

By Lochard | As a newbie programmer | 16 May 2023


Problem: Jimmy wants to buy books for N students. He went to the bookshop to buy a bundle of books, each bundle has a different number of books. He wants to buy such a bundle that contains the number of books, which can be distributed equally amongst all the students.

Input: First line contains T, number of test cases.

Each test case contains two integers, N and M. where is N is number of students and M is number of books in a bundle.

Output: In each test case output "Yes" if he can buy that bundle and "No" if he can't buy that bundle.

Constraints: 1<=T<=20

1<=N<=100

1<=M<=10^5

Sample Input: 2

5 14

3 21

Sample Output: 

No

Yes

for i in range(int(input())):
  n, m = map(int, input().split())
  print('No' if m % n else 'Yes')

How do you rate this article?

2


Lochard
Lochard

20240228 Arrived in the UK for about 2 week. All my fears persist. Some are even getting worse. https://github.com/locharp/asylum_diary/


As a newbie programmer
As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.