← All problemsSign in

Minimum Sum

Chef has a sequence of n positive numbers: $A1, A2, A3,......., AN.$ He do not like big numbers so, he want to minimize the numbers as much as possible by doing several operations In this operation he select two indices of the sequence i and j such that $(Ai >Aj)$ then apply a assignment $Ai = Ai - Aj $ He can apply this operation as many time he want and his ultimate goal is to make the sum of

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