{"raw_statement":[{"iden":"problem statement","content":"You are given $N$ integers. The $i$\\-th integer is $a_i$. Find the number, modulo $998244353$, of ways to paint each of the integers red, green or blue so that the following condition is satisfied:\n\n*   Let $R$, $G$ and $B$ be the sums of the integers painted red, green and blue, respectively. There exists a triangle with positive area whose sides have lengths $R$, $G$ and $B$."},{"iden":"constraints","content":"*   $3 \\leq N \\leq 300$\n*   $1 \\leq a_i \\leq 300(1\\leq i\\leq N)$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$a_1$\n$:$\n$a_N$"},{"iden":"sample input 1","content":"4\n1\n1\n1\n2"},{"iden":"sample output 1","content":"18\n\nWe can only paint the integers so that the lengths of the sides of the triangle will be $1$, $2$ and $2$, and there are $18$ such ways."},{"iden":"sample input 2","content":"6\n1\n3\n2\n3\n5\n2"},{"iden":"sample output 2","content":"150"},{"iden":"sample input 3","content":"20\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n3\n2\n3\n8\n4"},{"iden":"sample output 3","content":"563038556"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}