|
|
вернуться в форумHints Factorize (in 1..9 figures) the N and then reduce the resulting number of figures. Re: Hints thanks a lot bro Re: Hints Послано Haloom 16 апр 2019 19:57 For each i = 9 to 2, repeatedly divide n by i until it cannot be further divided or the list of numbers from 9 to 2 gets finished. Also, in the process of division push each digit i onto the stack which divides n completely. After the above process gets completed check whether n == 1 or not. If not, then print “-1”, else form the number k using the digits from the stack containing the digits in the same sequence as popped from the stack |
|
|