QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 512 MB Total points: 100

#8761. 另一个计数问题

الإحصائيات

题目描述

给定一个 $n - 1$ 个点的无向图,点的编号为 $2 \sim n$。对于所有的 $2 \le u < v \le n$,边 $(u, v)$ 存在当且仅当 $v$ 是 $u$ 的正整数倍。定义 $f(u, v)$ 表示 $u$ 与 $v$ 是否连通:当 $u, v$ 连通时 $f(u, v) = 1$,否则 $f(u, v) = 0$。求:

$$\left(\sum_{u = 2} ^ {n - 1} \sum_{v = u + 1} ^ n f(u, v) \cdot u \cdot v\right) \bmod {998244353}$$

输入格式

从标准输入读入数据。

输入一行一个正整数 $n$。保证 $4 \le n \le 10 ^ {11}$。

输出格式

输出到标准输出。

输出一行一个非负整数表示答案。

样例

输入

4

输出

8

解释

$f(u, v) = 1$ 当且仅当 $u = 2, v = 4$,故答案为 $2 \times 4 = 8$。

样例

输入

6

输出

80

解释

所有满足 $f(u, v) = 1$ 的 $(u, v)$ 为:$(2, 3), (2, 4), (2, 6), (3, 4), (3, 6), (4, 6)$。

样例

输入

127

输出

23573971
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.