← All problemsSign in

Product of Digits

The chef may be losing his mind. He has demanded you solve the following task: given an integer P, find the smallest positive integer whose product of digits, modulo 1000000007, is P. You can't imagine what this has to do with cooking, but you'd better do what he says or you won't get to sample his culinary delights. Input: Input will begin with a positive integer TOutput: For each test case,

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start