#include #include typedef long long ll; using namespace std; const ll N = 30; const ll C = N/2; const ll R = N+1; ll STATE; ll D[R*C][(1<<(C+1))]={{1}}; ll row, col; ll bit; ll ans; void calculate(int mode){ for(long long int i=0; i>1; if((row=C && row-C)){ D[i+1][bit] += D[i][j]; continue; } if(col == C-1 && (mode & (1 << rrow))){ D[i+1][bit] += D[i][j]; continue; } if(bit&1) D[i+1][bit] += D[i][j]; else{ if(!(bit&2) && col