I was recently using this program that I made for a question I was asked.
It goes as follows,
"Kevin and Devin each make one hat per day for charity, but they started on different days. Today, Kevin made his 520th hat, and Devin made his 50th. A celebration is planned for the next day that Kevin’s hat count is evenly divisible by Devin’s hat count. In how many days from today will they celebrate?"
I made it so that my code could work for any number of hats Kevin and Devin start with. My code only checks for the first 1000 days, so the program does not go on forever.
I was wondering, is there a way to check if Kevin and Devin will ever celebrate, given to numbers to start with?
MAX = min(kevin-2*devin, int(kevin/devin)). Am I not understanding what you are saying, or is something else different? (For an example of a case that does not work, try 575 and 67) – nedla2004 Oct 08 '16 at 19:42