#include #include #include using namespace atcoder; using mint = modint998244353; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000001 int main(){ int n; cin>>n; bitset<10005> B; B[0] = 1; int S =0; rep(i,n){ int w; cin>>w; S += w; B |= B<