https://acs.jxnu.edu.cn/problem/ICPCJX2020A
描述:
Huanhuan challenges you to a simple math problem.
Define F(x)F(x) as the sum of the decimal digits of 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.
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.
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).
输出:
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
题目大意:
欢欢向你挑战一个简单的数学题,把F(X)F(X)定义为xx的十进制数之和。
例如:F(123)=1+2+3=6F(123)=1+2+3=6,F(700)=7+0+0=7F(700)=7+0+0=7
满足 1≤j≤i≤n1≤j≤i≤n ji.j是相互作用的。
更正式地说,计算>i=1n>j=1i[gcd(j,i)=1]F(J)>i=1n>j=1i[gcd(j,i)=1]F(J)。
输入:
只有一个单整数n(1≤n≤105)n(1≤n≤105)的测试用例。
输出:
打印一个整数,回答为>i=1n>j=1i[gcdj,i)=1]F(I)>i=1n>j=1i[gcdj,i)=1]F()。
样例输入:
3
样例输出:
5