← All problemsSign in

Hatim and Arithmetic

Arithmetic is Hatim's favorite subject, but what spoils it for him is that Riya is in his class, and she is better than him at it. Prime numbers are of mystical importance in Arithmetics, and Lucky Numbers even more so. Lucky Numbers are those positive integers that have at least three distinct prime factors; 30 and 42 are the first two. Hatim's teacher has given them a positive integer n, and has

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