#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++) #define ALL(x) (x).begin(), (x).end() const double PI = acos(-1); int ret = 0; void go(int mask, int acc, const vector &a) { if (!mask) { ret = max(ret, acc); return; } int h = -1; REP (i, a.size()) { if (mask & 1<> n; vector a(n); REP (i, n) cin >> a[i]; go((1<