Find the maximum value of $(\prod{a_i})$ given that $\sum a_i=2017$ for $n$ number of positive integers from $a_1, a_2, \cdots, a_n$
I don't understand how to do it. I had thought of proceeding by AM-GM and got to the conclusion that $\bigg(\frac{2017}{n}\bigg)^n \geq a_1a_2 \cdots a_n$ and then we can check how the function (LHS) increases and work on that. But I can't do it.
May I get some help?