Number Theory
CodeChefOpen on judge ↗
Hari loves to play with numbers. He finds that the numbers 4 and 7 are lucky for him. So he also considers positive integer numbers whose decimal representation contains only the lucky digits 4 and 7 as lucky. For example, numbers 47, 744, 4 are lucky for him and 5, 17, 467 are not. Hari calls a number almost lucky if it could be evenly divided by some lucky number. Help him find out if the give
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.
Sign in to chat with the tutor and save your progress.
Sign in to start