Finitely convergent algorithm for nonconvex inequality problems