Codeforces Gym101063 F.Bandejao (2016 USP-ICMC)

 

F.Bandejao

 

It is lunch time on Mars! Everyone has got that big smile on their faces, all eager to see what the GEMA restaurant is serving for dessert. Everything is pretty much like Earth, but nobody knows why, GEMA decided to invent new types of utensils. Somehow, the food research group concluded that the usual fork, knife and spoon would not be so adequate on Mars.

There are K types of utensils and if you want to have some food, you must use all Kof them (one of each). You like to have lunch with your N friends, and when you are leaving, you want to distribute the utensils among you and all your friends equally (everyone having the same amount of utensils). In addition to that, you want each one of your friends (you included) to carry only one type of utensil (it speeds up the process of leaving the restaurant, and your friends get really mad when it takes more time than usual for them to get back to work).

Given N and K, answer if it is possible for you and your friends to leave the restaurant with everyone carrying the same number of utensils and each one carrying only one type of utensil.

Input

Two integers N and K (0 ≤ NK ≤ 100 and K > 0). (You and your friends form a group of N + 1 people).

Output

Print "yes" (if it is possible) or "no" without quotes.

Example

Input
1 2
Output
yes
Input
1 3
Output
no

 


代码:

 1 #include
 2 #include
 3 #include
 4 #include
 5 #include
 6 #include
 7 #include
 8 #include
 9 #include
10 #include
11 #include
12 #include
13 using namespace std;
14 typedef long long ll;
15 const int N=1e5+10;
16 int main(){
17     int n,k;
18     while(~scanf("%d%d",&n,&k)){ 19 n+=1; 20 if(n%k==0)printf("yes\n"); 21 else printf("no\n"); 22  } 23 return 0; 24 }

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/ZERO-/p/9695542.html

你可能感兴趣的:(Codeforces Gym101063 F.Bandejao (2016 USP-ICMC))