Given a positive number, form it with n positive numbers, what's the maximum product of them? Assume that a constant $a=\sum_{k=1}^{n}a_k, n≥1, $let $A = \prod_{k=1}^{n}a_k, n≥1$, how to find the maximum of A?
Here is what I have tried:
First by Geometric-arithmetic mean inequality, I got $A ≤ (\frac{a}{n})^n$. Then let  $f(x) =  (\frac{a}{x})^x$, and so by derivation I got $f'(x) = {(\frac{a}{x})^x}\ln\frac{a}{ex}$, so $f(x)$ increases in$ (0,\frac{a}{e})$ and decreases in $(\frac{a}{e}, \infty^+)$, then I'm stuck...
Update: There seem no solutions if I restrict $a_n, n=1,2,\dots,n$ to any postive real numbers. What if they are postive integers?
 A: We assume that $a$ is positive, and that we can take any $n$ we like. 
First, let's deal with the case where $a$ and all the $a_i$ are integers. Then you maximize the product as follows: 
If $a$ is a multiple of three, take $a_i=3$ for all $i$. 
If $a$ is one more than a multiple of three, take $a_1=a_2=2$, $a_i=3$ for all $i\ge3$. 
If $a$ is two more than a multiple of three, take $a_1=2$, $a_i=3$ for all $i\ge2$ (the exceptional case $a=1$ is left to the reader). 
Proof. There's clearly no reason ever to take $a_i=1$ (except when $a=1$). Any product with any $a_i\ge5$ can be increased by replacing that $a_i$ with $2$ and $a_i-2$. If $a_i=a_j=4$, you can do better replacing the two fours with a two and two threes, so there's at most a single four. A four and a two can be replaced with two threes. So if there's a four, then there's only one of them, and all the rest of the $a_i$ are threes. Now you can replace the four with two twos, with no change in the product. So we may assume the $a_i$ are all twos and threes. Now you're better off with two threes than with three twos, so the number of twos must be none, one, or two, and we're done. 
Now let's look at the case where the $a_i$ can be positive reals. If two are not equal, say, $a_j<a_k$, then you are better off replacing them with two copies of $(a_j+a_k)/2$, so we can assume all the $a_i$ are equal. Now the Calculus kicks in, and you want $n$, the number of the $a_i$, to be either the greatest integer not exceeding $a/e$, or the smallest integer not less than $a/e$. Maybe there's a simple rule for deciding (for each $a$) which of these two values to take for $n$, or maybe you just try both and see which gives you the bigger product. 
