#include using namespace std; using ll = long long; using pll = pair; constexpr char ln = '\n'; constexpr long long MOD = 1000000007; constexpr long long INF = 1<<30; constexpr long long LINF = 1LL<<60; constexpr double EPS = 1e-9; #define all(v) v.begin(), v.end() #define rep(i, n) for(int i=0;i<(n);i++) #define rept(i, j, n) for(int i=(j); i<(n); i++) template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } int main(){ //dp[S]:=購入した商品の集合がSの場合、最小購入金額 ll N; cin >> N; vector A(N); rep(i, N) cin >> A[i]; vector dp(1<>i&1)){ ll sum = 0; rep(j, N)if(mask>>j&1)sum += A[j]; chmin(dp[mask + (1<