I am trying to solve this problem using ternary search.
It asks to find the maximum of the function x^a·y^b·z^c. Where, x+y+z <= S.
I understood the concept of ternary search but I am unable to apply it to this particular problem.
Can somebody help ?