Linear Programming Piecewise Function