if $$\sum_{j=1}^n k_j =S $$ what is the minimum for $$\prod_{j=1}^n k_j$$ where S,n are natural numbers and $1 \le k_j \le p_j$ ($p_j$ are primes)
I try to first full the capacity of $k_j$ that has smaller boundaries which here is $k_1$ then if there be any reminder we put it in the $k_2$ then if still there be any reminder we continue to putt them in $k_j$ with smaller $j$ until there be no more S to put in our variable and the rest of $k_j$ will be $1$ .
Is this a good approach ?
If yes , how we can formalizing this algorithm ?
edit: I tried some example and I find out that this algorithm or any other like this does not always give us the minimum of the products .
what should we do to find minimum of products ?!