#include using namespace std; #define ALL(x) begin(x),end(x) #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b ostream &operator<<(ostream &os,const vector&v){ for(int i=0;i<(int)v.size();i++) os< istream &operator>>(istream &is,vector&v){ for(T &x:v)is>>x; return is; } const int H=4,W=4; const int N=16; const int T=217; signed main(){ vector add(1<>num)&1){ rep(k,4){ int ni=i+dx[k],nj=j+dy[k]; int nnum=ni*4+nj; if(0<=ni and ni<4 and 0<=nj and nj<4){ if(!((bit>>nnum)&1)) add[bit]++; } } } } } vector> dp(1<(T,0)); dp[0][0]=1; for(int bit=0;bit<(1<>num)&1) continue; int nxt=bit|(1<>K; cout<