1011: Sticks

DFS with optimization