A two-segment approximation algorithm for separable convex programming with linear constraints