piecewise function word problem