4784 AC

4784 brute force, 370 BFS, 10070 NC
403 AC