scan-and-solve