Problem B
Divide and Conquer
Most people have heard of Julius Caesar, a Roman dictator who lived in the first century BC and who was famous, amongst other things, for defeating enemies by pitting them against each other, thereby preventing them from uniting against him, a strategy known as “Divide and Conquer”. A lesser known fact is that Julius Caesar had a grandfather named Julius Senior, an old man who has miraculously lived to this day and who currently resides in an old age home in the town of Quackville.
Life in the old age home is mostly dull, but every Friday, Julius Senior and his compatriots have a rousing game of Bingo! The stakes are especially high, for not only does the victor gain the much-coveted title of “Bingo Champion”, but there is also a reward of several sour candies. Julius Senior finds Bingo fun, but after never having won even once over all these millennia, the militaristic tendencies present in his family have begun to manifest themselves, and he has hatched a plot to gain the sour candies by illegitimate means. For his plan, he will need to make use of some divisibility hacks.
A divisibility hack is a mental math trick that can be used
to easily decide which positive integers
is the base-
where
For example, it turns out that
Julius Senior’s nefarious scheme is to disseminate knowledge of some specific divisibility hacks to a select group of senior citizens, and to train them to go rabid when he says the trigger word “MAPS” (Multiples Are Pretty Sick), using their divisibility hacks to scream facts about integers dividing or not dividing other integers at each other. His plan is to do this in the middle of their next Bingo tournament, whereupon he can take advantage of the ensuing chaos to purloin the sour candies without anyone noticing.
Unfortunately, Julius Senior’s math skills aren’t what they
used to be, so he is having a hard time coming up with
divisibility hacks. In fact, when he randomly chooses integers
Input
The input consists of two space-separated integers,
Output
If there exists a positive integer
Sample Input 1 | Sample Output 1 |
---|---|
10 11 |
yes |
Sample Input 2 | Sample Output 2 |
---|---|
10 7 |
yes |
Sample Input 3 | Sample Output 3 |
---|---|
10 3 |
no |