Here is the problem:
$$L = \sum_{i\in [1,n]} a_i x_i \\ s.t. \sum_{i\in [1,n]} x_i = 1, \text{and } x_i >= 0 $$
I think this is a linear programming problem, and I tried to solve it by Lagrange multiplier but no idea at all.
However, I know that the solution is $$x = [0,...,x_k=1,0,0,0], \text{where } k = \text{argmax}_i(a_i)$$ , but how to solve it formally?