101985: [AtCoder]ABC198 F - Cube

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $600$ points

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$.


Sample Input 1

8

Sample 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.


Sample Input 2

9

Sample Output 2

5

Sample Input 3

50

Sample Output 3

80132

Sample Input 4

10000000000

Sample Output 4

2239716

Find the count modulo $998244353$.

Input

题意翻译

### 题目描述 在立方体的六面各写下一个正整数,使得这些数的和为$S$。 如果两个立方体能够通过旋转使得对应面的数字都相同(数字不考虑朝向),则这两个立方体视为本质相同。 给定$S$,请问有多少个本质不同的立方体?答案对$998244353$取模。 ### 输入数据 一个正整数$S,6\leqslant S\leqslant 10^{18}。$ ### 输出数据 本质不同的立方体数量,答案对$998244353$取模。 ### Sample Explanation 1 有两种数字的选择: 1. $1,1,1,1,1,3$,产生$1$个本质不同立方体 2. $1,1,1,1,2,2$,产生$2$个本质不同立方体(分别为两个$2$相邻或相对) 所以总共有$3$个本质不同立方体,答案为$3$。 ### Sample Explanation 4 请将答案对$998244353$取模。

加入题单

上一题 下一题 算法标签: