{"problem":{"name":"12 Directions","description":{"content":"On a 2D coordinate plane, there is a piece placed at $(0, 0)$.   You will perform the following operation $N$ times: *   Choose an integer $i$ such that $0 \\leq i \\leq 11$.       If the current posit","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"fps_24_v"},"statements":[{"statement_type":"Markdown","content":"On a 2D coordinate plane, there is a piece placed at $(0, 0)$.  \nYou will perform the following operation $N$ times:\n\n*   Choose an integer $i$ such that $0 \\leq i \\leq 11$.  \n    If the current position of the piece is $(x, y)$, move it to $(x + \\cos(30i)^\\circ, y + \\sin(30i)^\\circ)$.\n\nCount the number of operation sequences that result in the piece being back at $(H, W)$ after $N$ operations, and output the result modulo $998244353$.\n\n## Constraints\n\n*   $1 \\leq N \\leq 2.5 \\times 10^5$\n*   $-N \\leq H \\leq N$\n*   $-N \\leq W \\leq N$\n*   $N, H, W$ are integers\n\n## Input\n\nThe input is given from standard input in the following format:\n\n$N$ $H$ $W$\n\n## Partial Score\n\nThis problem has partial scoring:\n\n*   If you solve all datasets with $(H, W) = (0, 0)$, you will earn $5$ points.\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"fps_24_v","tags":[],"sample_group":[["2 0 0","12\n\nFor every integer $n$ such that $0 \\leq n \\leq 11$, if the first operation chooses $i = n$ and the second operation chooses $i = (n+6) \\bmod 12$, the condition is satisfied. Thus, there are $12$ valid sequences."],["123456 0 0","352845935"],["50 -12 34","391874286"],["234567 89012 -34567","523418763"]],"created_at":"2026-03-03 11:01:14"}}