Comments

thanks a lot!

Hi, how to solve E?

I have a solution if there has no constraint of P & M, that is: Greedily choose '+', but if expression satisfies |E1 — E2| > |E1 + E2| and it's not leftmost expression, choose '-', such that the answer is optimal.

But I have no idea about with constraint of P & M.