#include using namespace std; using ll = long long; template using Pa = pair; template using vec = vector; template using vvec = vector>; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vec A(N); for(auto& x:A) cin >> x; int inf = 1e9; int M = 1e4; vvec dp(N+1,vec(M+1,inf)); dp[0][0] = 0; for(int i=0;i