#include<stdio.h>
#include<stdbool.h>
#include <malloc.h>
#define M 8
#define N 8
#define maxsize 100
int mg[M+2][N+2]=
{
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},//0
{1, 0, 0, 1, 0, 0, 0, 1, 0, 1},//1
{1, 0, 0, 1, 0, 0, 0, 1, 0, 1},//2
{1, 0, 0, 0, 0, 1, 1, 0, 0, 1