Singles‘ Day(or One‘s Day), an unofficial holiday in China, is a pop culture entertaining holiday on November 11 for young Chinese to celebrate their bachelor life. With the meaning of single or bachelor of number ‘1‘ and the huge population of young single
man. This festival is very popular among young Chinese people. And many Young bachelors organize parties and Karaoke to meet new friends or to try their fortunes that day.
On Singles‘ Day, a supermarket has a promotional activity. Each customer will get a ticket on which there are two integers b and N, representing an integer M that only contains N digits 1 using b as
the radix. And if the number M is a prime number, you will get a gift from the supermarket.
Since there are so many customers, the supermarket manager needs your help.