ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
back to board

Discussion of Problem 1014. Product of Digits

Posted by Marius Zilenas 16 Oct 2013 15:03
Factorize (in 1..9 figures) the N and then reduce the resulting number of figures.
Re: Hints
Posted by Ealham Al Musabbir 9 Jul 2015 16:05
Re: Hints
Posted by abdur rahman shajib 11 Oct 2018 13:39
thanks a lot bro
Re: Hints
Posted by Haloom 16 Apr 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