原网址:https://acs.jxnu.edu.cn/problem/NOIOPJCH02077215
描述:
Huanhuan challenges you to a simple math problem.
Define F(x)F(x) as the sum of the decimal digits of xx.
//嬛嬛给你一个简单的数学问题。
定义F(x)F(x)是十进制xx的和。
For example: F(123)=1+2+3=6F(123)=1+2+3=6, F(700)=7+0+0=7F(700)=7+0+0=7.
//例如:F(123)=1+2+3=6.......
Huanhuan wants you to calculate the sum of F(j)F(j) for every i,ji,j that satisfy 1≤j≤i≤n1≤j≤i≤n and i,ji,j are coprime.
//嬛嬛希望你能计算用F(j)F(j)计算任意i,ji,j(1≤j≤i≤n1≤j≤i≤n 并且 i,ji,j are coprime.)
More formally, calculate ∑i=1n∑j=1i[gcd(j,i)=1]F(j)∑i=1n∑j=1i[gcd(j,i)=1]F(j).
//正式一点来说,计算。。。。。
输入:
There are only one test case with a single integer n(1≤n≤105)n(1≤n≤105).
//一个带有一个数字的测试样例n(1≤n≤105)
输出:
Print one integer, the answer of ∑i=1n∑j=1i[gcd(j,i)=1]F(j)∑i=1n∑j=1i[gcd(j,i)=1]F(j).
//输出一个整数,所计算的答案
样例输入:
3
样例输出:
5