solution for uva 10795