# Include <stdio. h>
# Include <fstream>
# Include <map>
# Include <set>
Using namespace STD;
# Include <stdio. h>
Typedef struct ctrlpoint
{
Int ncount;
Set <int> value;
} Ctrlpoint;
Int end [5] = {59,60, 61,62, 63 };
Int begin [5] = {0, 1, 2, 3, 4 };
Ctrlpoint ctlpoint [64] = {0 };
Bool getnextvalue (int * pdata, int POS)
{
Pdata [POS] ++;
If (pdata [POS] <= end [POS])
Return true;
Int nnext = pos-1;
While (nnext> = 0)
{
Pdata [nnext] ++;
If (pdata [nnext] <= end [nnext])
{
For (INT I = nnext; I <Pos; I ++)
Pdata [I + 1] = pdata [I] + 1;
Return true;
}
Else
-- Nnext;
}
Return false;
}
Void getctrlpoint (INT num, ctrlpoint * pctrl)
{
Int x = num/8;
Int y = num % 8;
Int I = 0;
Int J = 0;
Pctrl-> ncount = 0;
For (INT I = 0; I <8; I ++)
{
Pctrl-> value. insert (x * 8 + I );
Pctrl-> ncount ++;
If (I = X)
Continue;
Pctrl-> value. insert (I * 8 + y );
Pctrl-> ncount ++;
}
I = x + 1;
J = Y + 1;
For (; I <8 & J <8; I ++, J ++)
{
Pctrl-> value. insert (I * 8 + J );
Pctrl-> ncount ++;
}
I = x + 1;
J = Y-1;
For (; I <8 & J> = 0; I ++, j --)
{
Pctrl-> value. insert (I * 8 + J );
Pctrl-> ncount ++;
}
I = X-1;
J = Y-1;
For (; I> = 0 & J> = 0; I --, j --)
{
Pctrl-> value. insert (I * 8 + J );
Pctrl-> ncount ++;
}
I = X-1;
J = Y + 1;
For (; I> = 0 & J <8; I --, J ++)
{
Pctrl-> value. insert (I * 8 + J );
Pctrl-> ncount ++;
}
}
Bool cancover ()
{
Set <int> pointset;
For (INT I = 0; I <5; I ++)
{
Ctrlpoint Ppoint = ctlpoint [begin [I];
// For (Int J = 0; j <Ppoint. ncount; j ++)
Pointset. insert (Ppoint. value. Begin (), Ppoint. value. End ());
}
If (pointset. Size ()> = 64)
{
Printf ("% d, total = % d \ n", begin [0], begin [1], begin [2], begin [3], begin [4], pointset. size ());
Return true;
}
Return false;
}
Int main ()
{
For (INT I = 0; I <64; I ++)
{
Getctrlpoint (I, & ctlpoint [I]);
}
While (1)
{
Cancover ();
If (! Getnextvalue (begin, 4 ))
Break;
}
Getchar ();
}