uva12442 dfs - optimization.