#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(vec) vec.begin(),vec.end() #define int long long bool chmin(int &a,int b){if(a>b){a=b;return true;}return false;} signed main(){ int n;cin>>n; int m[n]; rep(i,n)cin>>m[i]; int bits=1; rep(i,n)bits*=2; int dp[bits]; fill(dp,dp+bits,(1LL<<60)); dp[0]=0; rep(b,bits-1){ rep(i,n){ if(b&(1<