#include using namespace std; int n, a; const int N = 20001; long long m = 0; long long dp[101][N]; const long long M = 998244353; int main() { cin >> n; dp[0][10001] = 1; for (int i = 1; i <= n; i++) { cin >> a; for (int j = 0; j < N; j++) { if (j >= a) dp[i][j] = (dp[i][j] + dp[i - 1][j - a]) % M; if (j <= 20001 - a) dp[i][j] = (dp[i][j] + dp[i - 1][j + a]) % M; } } for (long long i = 10002; i <= 20001; i++) m = (m + dp[n][i] * (i - 10001) * 2) % M; cout << m << endl; }