QOJ.ac

QOJ

Time Limit: 6.0 s Memory Limit: 256 MB Total points: 100

#11970. 计算 a * b

Statistics

Marry 喜欢计算选择两个小于 $m$ 的非负整数 $a$ 和 $b$,使得 $a \times b \pmod m \neq 0$ 的方案数。

记 $f(m)$ 为选择两个小于 $m$ 的非负整数 $a$ 和 $b$,使得 $a \times b \pmod m \neq 0$ 的方案数。

她已经计算了许多不同 $m$ 下的 $f(m)$,现在她对另一个函数 $g(n) = \sum_{m|n} f(m)$ 感兴趣。例如,$g(6) = f(1) + f(2) + f(3) + f(6) = 0 + 1 + 4 + 21 = 26$。她需要你帮她核对答案。

给定 $n$,你的任务是求出 $g(n)$ 对 $2^{64}$ 取模的结果。

输入格式

第一行包含一个整数 $T$,表示测试用例的总数。每个测试用例占一行,包含一个正整数 $n$。

  • $1 \le T \le 20000$
  • $1 \le n \le 10^9$

输出格式

对于每个测试用例,输出一个整数 $s$,表示 $g(n)$ 对 $2^{64}$ 取模的结果。

样例

输入 1

2
6
514

输出 1

26
328194

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.