Palak
1 min readJun 15, 2020

--

The main point of the article was to prove why combination of 3 makes the product largest. Once this is clear all you have to do is to find a combination containing
i) max number of 3’s whose sum is either less than or equal to N
ii) N%3 i.e the remainder of N/3. (required in those cases when 3 can’t perfectly divide N, when 3 does, it would be 0).
So in case of 10, maximum number of 3’s is 3 (10/3 = 3) and 10%3 = 1. Thus our combination is 3, 3, 3, 1.
Sum = 3 + 3 + 3 + 1 = 10
Product = 3*3*3*1 = 27
Similarly, when N = 18, combination will be 3, 3, 3, 3, 3, 3.(18/3 = 6)
sum = 3 + 3 + 3 + 3 + 3 + 3 = 18
product = 3⁶

--

--

Responses (1)