#include using namespace std; bool space[29][29] = {false,}; double probability[4]; int directionX[4] = {1, -1, 0, 0}; int directionY[4] = {0, 0, -1, 1}; int moveCount; double dfs(int x, int y, int moveCount) { int nextX; int nextY; if (moveCount == 0) { return 1.0; } space[x][y] = true; double result = 0.0; for (int i = 0; i < 4; i++){ nextX = x + directionX[i]; nextY = y + directionY[i]; if (s..