solution for uva 1532