#include #include #include #include using namespace std; using ll = long long; int main(void){ int n; cin >> n; vector d(n); for(auto&x:d) cin >> x; int mx=(1<(n+1, -1)); dp[0][0]=100; for(int i=0; i=0){ for(int k=0; k>k&1)){ int hp=dp[i][j], nj=j; if(d[k]>0) hp=min(100*(j+1), hp+d[k]); else{ if(hp+d[k]<=0) continue; hp+=d[k]; nj++; } dp[i|(1<