C++ program to generate and solve mazes