#include #include using namespace std; const int MXN=200; int a[MXN][MXN],b[MXN]; void fills(int x, int y) { int z=a[x][y]; /*if (z!=-1) { int v=-1-a[x][y]; int e=min(x+v,MXN-1); a[x][y]=0; a[e][y]=-1; fills(e,y); e=min(y+v,MXN-1); a[x][e]=-1; fills(x,e); return; }*/ for (int i=x; i>=0 && (i==x || a[i][y]==0); i--) for (int j=y; j>=0 && ((i==x && j==y) || a[i][j]==0); j--) a[i][j]=z; } void fillt(int x, int y) { int z=a[x][y]; /*if (z!=1) { int v=a[x][y]-1; int e=max(x-v,0); a[x][y]=0; a[e][y]=1; fillt(e,y); e=max(y-v,0); a[x][e]=1; fillt(x,e); return; }*/ for (int i=x; i=0 && r