Under construction

Still being built. Things may change

Super Lucky Tickets

Time limit2sMemory limit1024 MB

Summary
Count digit strings of even length n where both half sums match and even-position and odd-position sums match, modulo 998244353.
Level

Medium7 of 10

Topics
Dynamic programming, Combinatorics, Math
Solved
No attempts yet

Problem

For a spaceship to take off, each crew member needs a ticket. Each ticket has a sequence of nn digits, where nn is a positive even number.

Daniil calls a ticket super-lucky if both of the following properties hold:

  • The sum of the first n2\frac{n}{2} digits equals the sum of the last n2\frac{n}{2} digits.
  • The sum of the digits at even positions equals the sum of the digits at odd positions.

Help Daniil count the number of distinct super-lucky tickets modulo 998 244 353998\,244\,353.

Input

The first line contains one number nn, the length of a ticket (2≤n≤200 0002 \le n \le 200\,000). It is guaranteed that nn is even.

Output

Print the number of super-lucky tickets of length nn modulo 998 244 353998\,244\,353.

Examples2

  1. Example 1

    Input
    2
    
    Expected output
    10
    
  2. Example 2

    Input
    8
    
    Expected output
    448900