{"raw_statement":[{"iden":"problem statement","content":"Given are integers $N$ and $X$. For each integer $k$ between $0$ and $X$ (inclusive), find the answer to the following question, then compute the sum of all those answers, modulo $998244353$.\n\n*   Let us repeat the following operation on the integer $k$. Operation: if the integer is currently odd, subtract $1$ from it and divide it by $2$; otherwise, divide it by $2$ and add $2^{N-1}$ to it. How many operations need to be performed until $k$ returns to its original value? (The answer is considered to be $0$ if $k$ never returns to its original value.)"},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2\\times 10^5$\n*   $0 \\leq X < 2^N$\n*   $X$ is given in binary and has exactly $N$ digits. (In case $X$ has less than $N$ digits, it is given with leading zeroes.)\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$X$"},{"iden":"sample input 1","content":"3\n111"},{"iden":"sample output 1","content":"40\n\nFor example, for $k=3$, the operation changes $k$ as follows: $1,0,4,6,7,3$. Therefore the answer for $k=3$ is $6$."},{"iden":"sample input 2","content":"6\n110101"},{"iden":"sample output 2","content":"616"},{"iden":"sample input 3","content":"30\n001110011011011101010111011100"},{"iden":"sample output 3","content":"549320998"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}