AT_fps_24_v 12 方向
Description
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 position of the piece is $ (x, y) $ , move it to $ (x + \cos(30i)^\circ, y + \sin(30i)^\circ) $ .
Count the number of operation sequences that result in the piece being back at $ (H, W) $ after $ N $ operations, and output the result modulo $ 998244353 $ .
Input Format
The input is given from standard input in the following format:
> $ N $ $ H $ $ W $
Output Format
Print the number of valid operation sequences, modulo $ 998244353 $ .
Explanation/Hint
### Partial Score
This problem has partial scoring:
- If you solve all datasets with $ (H, W) = (0, 0) $ , you will earn $ 5 $ points.
### Sample Explanation 1
For 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.
### Constraints
- $ 1 \leq N \leq 2.5 \times 10^5 $
- $ -N \leq H \leq N $
- $ -N \leq W \leq N $
- $ N, H, W $ are integers