← All problemsSign in

Balanced Array

CodeChefRating 2063Open on judge ↗

Hussain really likes playing with arrays. Today he challenged his friend Farah to beat a game he has invented recently. Hussain will give Farah an array of N positive integers. Farah is allowed to do this move multiple times: Farah can choose three integers (i , j , k) such that k is a positive integer, 1 ≤ i,j ≤ N, and A[i] is divisible by k. Then she should do the following : A[i] = A[i] / k

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