All submissions for this problem are available.
Multiplying two natural numbers is really a clumsy operation. However, sometimes we can get the answer by moving the last digit to the front
For example: 179487 * 4 = 717948
This property obviously depends on the number system you are using, the above being decimal number system.In base 9 we can have:
17 * 4 = 71 (base 9)
as (9 * 1 + 7) * 4 = 7 * 9 + 1
NOTE: ALL NUMBERS IN THIS PROBLEM ARE NOT DECIMAL NUMBERS
The input given is a text-file which will end with the standard end-of-file marker. Each line of the text-file has 3 numbers (separated by a space) : The base for the number system, the least significant digit of the first factor, and the second factor. This second factor is one digit only hence less than the base.
Your job is to find out for each input line the number of digits of the smallest first factor with the rotamultproperty. The output-file is also a text-file. Each line contains the answer for the corresponding input line.
10 7 4 9 7 4 17 14 12
6 2 4
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.