#include using namespace std; #include using namespace atcoder; using ll = long long; int n; int dp[1<<16]; vector a; void solve(){ dp[0] = 100; for(int bit =1;bit<(1<>i&1){ if(a[i]<0)cap+=100; } } for(int i = 0;i>i&1){ int x = min(cap,dp[bit-(1<0){ dp[bit] = max(dp[bit],x); } } } } cout<> n; a = vector(n); for(auto &i:a)cin >> i; solve(); }