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.