uva 1422 solution