MinMaxDivision solution