← All problemsSign in

LCM of Numbers

Petya has number Y. He is sorting through the numbers X from 1 to 10^18, and for every X writes [X,Y]÷X on blackboard. Here [X,Y] stands for least common multiple of X and Y. Petya is very lazy, that's why this task bored him soon. But he is interested in how many different numbers he would write on the board if he would finish the task. Help him to find the quantity of different numbers he would

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