#include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long int; #define chmax(x,y) (x) = ((x) > (y)) ? (x) : ((x) = (y)); #define chmin(x,y) (x) = ((x) < (y)) ? (x) : ((x) = (y)); const int INF = 1e9; const ll INFL = 1e18; const int Mod = 1e9 + 7; const int dx[] = {0,1,0,-1}; const int dy[] = {1,0,-1,0}; int main(int argc, char const *argv[]) { int N; cin >> N; vector W(N); for(auto &a: W)cin >> a; vector> dp(N+1,vector(2001)); dp[0][0] = 1; for(int i=0;i