問題一覧 > 通常問題

No.2940 Sigma Sigma Div Floor Problem

レベル : / AI推定難易度 : 800 / 実行時間制限 : 1ケース 6.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 100
作問者 : kazuppa / テスター : highlighter Magentor hirayuu_yc
お気に入りにしたユーザー ProblemId : 11225 / 自分の提出
問題文最終更新日: 2025-09-10 22:58:43
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 450 (順位表) の他の問題:

Problem Statement

You are given a positive integer $N$.

Find $\left(\displaystyle\sum_{i=1}^N\displaystyle\sum_{j=1}^i\left\lfloor \dfrac{i}{j}\right\rfloor \right)\bmod{998244353}$.

Input

The input is given from Standard Input in the following format.
$N$

Constraints

  • $1\leq N\leq 1.2 \times 10^6$
  • $N$ is an integer.
This problem also has evil cases, which do not affect the AC verdict. If you have energy to spare, please try them.

Constraints for evil cases
  • $1\leq N\leq 10^{15}$
  • $N$ is an integer.
If you are not attempting the evil cases, the judging will finish faster if your program terminates immediately when the input does not satisfy the normal constraints.

Output

Output the answer to the expression on one line.

Print a newline at the end.

Sample

Sample 1
Input
2
Output
4

Since $\left\lfloor \dfrac{1}{1} \right\rfloor =1,\left\lfloor \dfrac{2}{1} \right\rfloor =2,\left\lfloor \dfrac{2}{2} \right\rfloor =1$, the answer is $1+2+1$, which equals $4$.

Sample 2
Input
5
Output
27

Sample 3
Input
100
Output
21803

Sample 4
Input
14691
Output
32934

Note that the answer must be taken modulo $998244353$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。