solution for uva 10318