#include#include #include #define MinLength 1#define MaxLength 64 #define MinWidth 1 #define MaxWidth 64 #define Black 0#define White 1#define Grey 2typedef struct node { int PositionX; int PositionY; int Value; int Width; int** MainArray; struct node* Sub4;}Node;void ExecuteFile ( char *File_Name, Node *node); void LayNode(Node* node,int PositionX, int PositionY, int Width, int Value, int** MainArray);int Validity (int x);void Quadtree(Node *node);int CheckColor (Node *node, int Top, int Bot, int Left, int Right);int** ProduceArray (Node *node, int Top, int Bot, int Left, int Right, int axis);int main ( int argc, char *argv ) //The main function is specified to start the program, resulting in reading all the functions.//{ Node RootNode; if ( argc != 2) { puts (“Error executing input!”); exit(-1); } ExecuteFile( argv1, &RootNode); Quadtree(&RootNode);}void ExecuteFile ( char *File_Name, Node* node ){ int CountedNumberofBlack=1, Counter=0, i, j, a, TerminalWidth, XValue, YValue, b, val, ValidSize, NumberofBlack; long StringSize, ReadSize; int** OriginalArray; char *buffer = NULL; FILE *fp; fp = fopen(File_Name,”r”); if (fp == NULL) { puts(“Invalid input file!”); exit (-1); } if (fp) { fseek(fp,0,SEEK_END); StringSize = ftell(fp); rewind(fp); buffer = (char*) malloc (sizeof(char) * (StringSize + 1) ); ReadSize = fread(buffer,sizeof(char),StringSize,fp); bufferStringSize = ‘