solution for uva 11039