#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n; Int f[30][30]; for(Int i=0;i>f[i][j]; Int s=1< dp(s,-INF); dp[0]=0; for(Int b=0;b>i)&1) u=i; for(Int i=0;i>i)&1) chmax(dp[b|(1<