Solution of Hallam’s problem on the terminal comparison principle for ordinary differential inequalities