{"raw_statement":[{"iden":"problem statement","content":"There are $N$ plates numbered $1$ through $N$. Dish $i$ has $a_i$ stones on it. There is also an empty bag.  \nYou can perform the following two kinds of operations any number of times (possibly zero) in any order.\n\n*   Remove one stone from each plate with one or more stones. Put the removed stones into the bag.\n*   Take $N$ stones out of the bag, and put one stone to each plate. This operation can be performed only when the bag has $N$ or more stones.\n\nLet $b_i$ be the number of stones on plate $i$ after you finished the operations. Print the number, modulo $998244353$, of sequences of integers $(b_1, b_2, \\dots, b_N)$ of length $N$ that can result from the operations."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq a_i \\leq 10^9$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$a_1$ $a_2$ $\\dots$ $a_N$"},{"iden":"sample input 1","content":"3\n3 1 3"},{"iden":"sample output 1","content":"7\n\nFor example, $b$ becomes $(2, 1, 2)$ by the following procedure.\n\n*   Perform the first operation. $b$ becomes $(2, 0, 2)$.\n*   Perform the first operation. $b$ becomes $(1, 0, 1)$.\n*   Perform the second operation. $b$ becomes $(2, 1, 2)$.\n\nThe following seven sequences can be the resulting $b$.\n\n*   $(0, 0, 0)$\n*   $(1, 0, 1)$\n*   $(1, 1, 1)$\n*   $(2, 0, 2)$\n*   $(2, 1, 2)$\n*   $(2, 2, 2)$\n*   $(3, 1, 3)$"},{"iden":"sample input 2","content":"1\n0"},{"iden":"sample output 2","content":"1\n\nThere are one sequence, $(0)$, that can be the resulting $b$."},{"iden":"sample input 3","content":"5\n1 3 5 7 9"},{"iden":"sample output 3","content":"36"},{"iden":"sample input 4","content":"10\n766294629 440423913 59187619 725560240 585990756 965580535 623321125 550925213 122410708 549392044"},{"iden":"sample output 4","content":"666174028"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}