#include //#include using namespace std; //using namespace atcoder; using ll = long long; //using mint = modint998244353; void solve(){ ll N, A, ans=0; cin >> N; vector S(N+1), MX(N+1), MI(N+1); for (int i=1; i<=N; i++){ cin >> A; S[i] = S[i-1] + A; MX[i] = max(MX[i-1], S[i]); MI[i] = min(MI[i-1], S[i]); } vector v={-1,1}; for (auto a : v){ for (auto b : v){ for (auto c : v){ for (int i=1; i> T; while(T--) solve(); return 0; }