need help for linearizing step function.

say "y" is depending on "x" such that,

y= ax if x is between 1 and 2

y= bx if x is between 3 and 4

y= cx if x is between 5 and 6

a, b and c are parameters/constant which will have values 8 or 9.

"y" is not final objective function and a, b and c must choose value either 8 or 9.

solution requested for maximizing/minimizing "y".

thanks.

**Best answer by mohansx**