BIRTHDAY PARTY
SOLUTION FOR BIRTHDAY PARTY HACKEREARTH
Mr. X's birthday is in next month. This time he is planning to invite N of his friends. He wants to distribute some chocolates to all of his friends after party. He went to a shop to buy a packet of chocolates.
At chocolate shop, each packet is having different number of chocolates. He wants to buy such a packet which contains number of chocolates, which can be distributed equally among all of his friends.
Help Mr. X to buy such a packet.
At chocolate shop, each packet is having different number of chocolates. He wants to buy such a packet which contains number of chocolates, which can be distributed equally among all of his friends.
Help Mr. X to buy such a packet.
Input:
First line contains T, number of test cases.
Each test case contains two integers, N and M. where is N is number of friends and M is number number of chocolates in a packet.
First line contains T, number of test cases.
Each test case contains two integers, N and M. where is N is number of friends and M is number number of chocolates in a packet.
Output:
In each test case output "Yes" if he can buy that packet and "No" if he can't buy that packet.
In each test case output "Yes" if he can buy that packet and "No" if he can't buy that packet.
Constraints:
1<=T<=20
1<=N<=100
1<=M<=10^5
1<=T<=20
1<=N<=100
1<=M<=10^5
Thanks For Your valuable posting, it was very informative
ReplyDeletechocolatesanddreams
Article submission sites
need code in pyhton
ReplyDeleteT=int(input("enter your number:"))
ReplyDeletefor i in range(T):
N=int(input("enter your no of persons:"))
M=int(input("enter no of chacolates:"))
if M%N==0:
print("yes")
else:
print("No")
#python code
Michael is celebrating his 10th birthday and he wished to arrange a party to all his class mate But there are n tough guys amongst his class who are weird. They thought that this is the best occasion for testing their friendship with him. They put up conditions before Michael that they will break the friendship unless he gives them a grand party on their chosen day Formally, th friend will break his friendship if he does not receive a grand party on dith day Michael is not a lavish spender and can give at most one grand party daily. Also, he wants to invite only one person in a party. So he just wonders what the maximum number of friendships
ReplyDeletehe can save.
Please help Michael in this difficult task.
need code in java
ReplyDelete