How to solve a linear inequalities problem?