AMOEBA - Amoeba
Dr. Fulano found a new species of microorganism, the fast-growing-amoeba. The colony of this
kind of amoeba grows vary fast. To find out the exacty rate of growth of the colony, Dr. Fulano
wrote down for several days, the number of amoebae in the colony. Soon he realized that each
individual generate daily, 6 new individuals. As the number of amoebae grew very quickly, Dr.
Fulano noted only the last K digits. When he realized that the numbers noted were repeated, it was
too late! The research was already well advanced and there was no time to recount. The solution
was to ask for help from you.
Doctor Fulano will give to you a number of K digits (0 < K < 10), possibly with leading zeroes. You
should answer the first day he wrote down that number. Consider that in day 1, the colony was
composed of 1 amoeba. Consider also that an amoeba does not disappear when generating his
If there is no answer to the number given, print -1.
The input is composed by various numbers, each in one line.
For each line in input, print a line in output. The line should contains the required answer without
600 Output: 1
I didn't understand the question perhaps. How the output is 20 for k=143 and 12 for k=743. Can someone explain the problem or the output?
what can be the maximum ans??Last edit: 2014-02-23 15:19:09
uzumaki: Read until the eof..
what is the no of input cases??
Fernando Fonseca [ITA]:
Diogo: I believe you're correct on both accounts.Last edit: 2012-04-09 01:27:16
Diogo Soares [UFAM]:
each output line has just 1 answer for each input line?? Is it the minimum number possible of days?
Last edit: 2012-05-05 22:06:41