AtCoder Beginner Contest 198
F
Cube
AtCoder
⌀ 2769
原题
← E→
翻译中…

Problem Statement

翻译中…

Let us write a positive integer on each face of a cube. How many ways are there to do this so that the sum of the six numbers written is $S$?

翻译中…

Here, two ways to write numbers are not distinguished when they only differ by rotation. (Numbers have no direction.)

翻译中…

The count can be enormous, so find it modulo $998244353$.

翻译中…

Constraints

翻译中…
  • $6 \leq S \leq 10^{18}$
  • $S$ is an integer.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

S

翻译中…

Output

翻译中…

Print the count modulo $998244353$.

翻译中…

样例

Input #1
8
Output #1
3
We have one way to write $1,1,1,1,1,3$ on the cube and two ways to write $1,1,1,1,2,2$ (one where we write $2$ on adjacent faces and another where we write $2$ on opposite faces), for a total of three ways.
Input #2
9
Output #2
5
Input #3
50
Output #3
80132
Input #4
10000000000
Output #4
2239716
Find the count modulo $998244353$.
题目信息
题号
abc198_f
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。