CODEVS 1295 (easy dfs)