0
$\begingroup$

The question is to partition a given number $n$ in exactly sum of $k$ distinct positive numbers such that the product of $k$ distinct number become maximum. $k$ will be given optimally so that it will be possible to partition.

For example:

1-$n$=5 and $k$ =2 partitions are {1,5} and {2,3} so answer will be max(1*5,2*3) i.e equal to 6.

2-$n$=6 and $k$=2 partitions will be {5,1} and {4,2} answer will be 8.

3-$n$=7 and $k$=3 partition will be {1,3,4} and {1,4,2} answer will be max(1*3*4,1*4*2) i.e equal to 12. Please help.Thanks in advance.

$\endgroup$
  • $\begingroup$ Please see math.meta.stackexchange.com/questions/5020 $\endgroup$ – Lord Shark the Unknown Oct 28 '18 at 5:56
  • $\begingroup$ Thank you for the advice. Will follow in future. $\endgroup$ – Paul Jay Oct 28 '18 at 5:59
  • $\begingroup$ Basically you need to make them as close to $n/k$ as possible $\endgroup$ – T_M Oct 28 '18 at 6:14
  • $\begingroup$ Yes, but how can I chose the number after then.Rest of the k-1 distinct number. $\endgroup$ – Paul Jay Oct 28 '18 at 6:16
  • $\begingroup$ Note that $1+3+4=8$ $\endgroup$ – Mark Bennet Oct 28 '18 at 6:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.