← All problemsSign in

Chef and easy problem 2

CodeChefRating 2020Open on judge ↗

Roma gave Chef an array of intergers. Chef wants to make all integers in the array equal to 1. In a single operation, he can select a prime number p and a subset of the integers, and then divide all of the integers in the subset by p. Chef can make this operation only if every integer in the selected subset is divisible by p. Please help Chef to make all the integers in the array equal to 1 wi

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