#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; } vector enumerate_subset(int bit,bool include_bit_empty=false){ vector ret; int subset=(bit-1)&bit; do{ ret.push_back(subset); subset=(subset-1)&bit; }while(subset!=0); if(include_bit_empty){ ret.push_back(0); if(0!=bit) ret.push_back(bit); } return ret; } const int n=16; signed main(){ vector> a(n,vector(n)); cin>>a; rep(i,n)rep(j,i) a[i][j]=a[j][i]*(-1); auto f=[&](int i,int j){ if(a[i][j]>0) return i; return j; }; vector> dp(1<(n,0)); for(int i=0;i=4 and popcount%2==0){ for(auto &l:enumerate_subset(bit)){ if(__builtin_popcount(l)==popcount/2){ int r=(bit^l); for(int i=0;i>i)&1){ for(int j=0;j>j)&1){ int k=f(i,j); dp[bit][k]+=dp[l][i]*dp[r][j]; } } } } } } rep(i,n){ cout<