CF1717E.Madoka and The Best University

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Madoka wants to enter to "Novosibirsk State University", but in the entrance exam she came across a very difficult task:

Given an integer nn , it is required to calculate lcm(c,gcd(a,b))\sum{\operatorname{lcm}(c, \gcd(a, b))} , for all triples of positive integers (a,b,c)(a, b, c) , where a+b+c=na + b + c = n .

In this problem gcd(x,y)\gcd(x, y) denotes the greatest common divisor of xx and yy , and lcm(x,y)\operatorname{lcm}(x, y) denotes the least common multiple of xx and yy .

Solve this problem for Madoka and help her to enter to the best university!

输入格式

The first and the only line contains a single integer nn ( 3n1053 \le n \le 10^5 ).

输出格式

Print exactly one interger — lcm(c,gcd(a,b))\sum{\operatorname{lcm}(c, \gcd(a, b))} . Since the answer can be very large, then output it modulo 109+710^9 + 7 .

输入输出样例

  • 输入#1

    3

    输出#1

    1
  • 输入#2

    5

    输出#2

    11
  • 输入#3

    69228

    输出#3

    778304278

说明/提示

In the first example, there is only one suitable triple (1,1,1)(1, 1, 1) . So the answer is lcm(1,gcd(1,1))=lcm(1,1)=1\operatorname{lcm}(1, \gcd(1, 1)) = \operatorname{lcm}(1, 1) = 1 .

In the second example, lcm(1,gcd(3,1))+lcm(1,gcd(2,2))+lcm(1,gcd(1,3))+lcm(2,gcd(2,1))+lcm(2,gcd(1,2))+lcm(3,gcd(1,1))=lcm(1,1)+lcm(1,2)+lcm(1,1)+lcm(2,1)+lcm(2,1)+lcm(3,1)=1+2+1+2+2+3=11\operatorname{lcm}(1, \gcd(3, 1)) + \operatorname{lcm}(1, \gcd(2, 2)) + \operatorname{lcm}(1, \gcd(1, 3)) + \operatorname{lcm}(2, \gcd(2, 1)) + \operatorname{lcm}(2, \gcd(1, 2)) + \operatorname{lcm}(3, \gcd(1, 1)) = \operatorname{lcm}(1, 1) + \operatorname{lcm}(1, 2) + \operatorname{lcm}(1, 1) + \operatorname{lcm}(2, 1) + \operatorname{lcm}(2, 1) + \operatorname{lcm}(3, 1) = 1 + 2 + 1 + 2 + 2 + 3 = 11

首页