#include #include using namespace std; static const int vect[]={ 0, 0, 1, 0, 0,-1, 0, 1, 0, 0, 1, 1, 0, 1,-1, 0,-1, 0, 0,-1, 1, 0,-1,-1, 1, 0, 0, 1, 0, 1, 1, 0,-1, 1, 1, 0, 1, 1, 1, 1, 1,-1, 1,-1, 0, 1,-1, 1, 1,-1,-1, -1, 0, 0, -1, 0, 1, -1, 0,-1, -1, 1, 0, -1, 1, 1, -1, 1,-1, -1,-1, 0, -1,-1, 1, -1,-1,-1, }; bool bcheck(int a,int n) { return (a>=0)&&(a>n>>m>>p,(n|m|p)!=0){ int bd[7][7][7]={0}; int phase=1; int winner=0; for (int i=0;i>x>>y;x--,y--; if (winner) continue; int z; for (z=0;bd[z][y][x]!=0;z++); bd[z][y][x]=phase; bool won=false; for (int z=0;z