The title describes that you have only one type a toy and now has a machine with two functions:
1. Processing a toy of type A can then get a toy of type A and a toy of type B.
2. A toy of type B can be processed with two toys of type B.
Q: After many processing, can you just get n B type toys and m a type of toys (you can't throw away any toys).
Enter two integers n,m (0<=n,m<=1e9) after processing the number of B-type toys and the number of a-type toys. Output can get just n b types of toys and m a type of toys output: Yes
Output: no example input
6 3
Sample output
Yes
Tips
example, using two times function 1, get three Class A toys and two Class B toys, and then use two times function 2, and then get 4 B toys, so that altogether got 6 toys B and 3 toys A.
#include <stdio.h>intMain () {intN, M; intFlag =0; scanf ("%d%d", &n, &m); if(M = =0&& n >0) {printf ("No"); return 0; } Else if(M-n >1) Flag=0; Else if((N-m +1) %2==0) Flag=1; if(Flag = =1) printf ("Yes"); Elseprintf ("No"); return 0;}
Question M: Cloning toys