Doubly Annoying Cheryl

Albert and Bernard just became friends with Cheryl, and they want to know when her birthday is. Cheryl gives them two unknowns: MM and D.D.

MM is the month of Cheryl's birthday (1-12)
DD is the day of Cheryl's birthday.

Cheryl then tells Albert the sum M+DM+D and she tells Bernard the product M×DM \times D.

Albert: "I don't know when Cheryl's birthday is, but I know that Bernard does not know too."
Bernard: "I could not figure out when Cheryl's birthday is, but I can now."
Albert: "Then I also figured out when Cheryl's birthday is."

What is the earliest Cheryl's birthday could be?

Input the month and day concatenated; e.g. September 14th is 914


Problem Loading...

Note Loading...

Set Loading...