Same Descent Set

AtCoder
IDagc060_d
Time6000ms
Memory256MB
Difficulty
Find the number of pairs $(P,Q)=((P_1,P_2,\cdots,P_N),(Q_1,Q_2,\cdots,Q_N))$ of permutations of $(1,2,\cdots,N)$ that satisfy the following condition, modulo $998244353$. * For every $i$ ($1 \leq i \leq N-1$), one of the two conditions below holds. * $P_i < P_{i+1}$ and $Q_i < Q_{i+1}$. * $P_i > P_{i+1}$ and $Q_i > Q_{i+1}$. ## Constraints * $2 \leq N \leq 2 \times 10^5$ * All numbers in the input are integers. ## Input The input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
2
Output #1
2

Two pairs, $(P,Q)=((1,2),(1,2))$ and $(P,Q)=((2,1),(2,1))$, satisfy the condition.
Input #2
3
Output #2
10
Input #3
4
Output #3
88
Input #4
10
Output #4
286574791
API Response (JSON)
{
  "problem": {
    "name": "Same Descent Set",
    "description": {
      "content": "Find the number of pairs $(P,Q)=((P_1,P_2,\\cdots,P_N),(Q_1,Q_2,\\cdots,Q_N))$ of permutations of $(1,2,\\cdots,N)$ that satisfy the following condition, modulo $998244353$. *   For every $i$ ($1 \\leq i",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 6000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "agc060_d"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Find the number of pairs $(P,Q)=((P_1,P_2,\\cdots,P_N),(Q_1,Q_2,\\cdots,Q_N))$ of permutations of $(1,2,\\cdots,N)$ that satisfy the following condition, modulo $998244353$.\n\n*   For every $i$ ($1 \\leq i...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments