#include #define debug(x) cerr << #x << ": " << x << '\n' #define debugArray(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge] << '\n' using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector vll; const ll INF = INT_MAX; const ll MOD = 1e9+7; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll N;cin>>N; ll A[20]; for(ll i=0;i>A[i]; ll dp[1<<15]={}; for(ll S=0;S<1<>i)&1)){ for(ll j=i+1;j>j)&1)){ dp[S|(1<