当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5663:Hillan and the girl

题目描述
“WTF! While everyone has his girl(gay) friend, I only have my keyboard!” Tired of watching others' affair, Hillan burst into scream, which made him decide not to hold it back.
“All right, I am giving you a question. If you answer correctly, I will be your girl friend.” After listening to Hillan, Girl replied, “What is the value of $\sum_{i=1}^n\sum_{j=1}^mf\left(i,j\right)$, where $f\left(i,j\right)=0$ if $\gcd\left(i,j\right)$ is a square number and $f\left(i,j\right)=1$ if $\gcd\left(i,j\right)$ is not a square number($\gcd\left(i,j\right)$ means the greatest common divisor of x and y)?”
But Hillan didn't have enough Intelligence Quotient to give the right answer. So he turn to you for help.
输入解释
The first line contains an integer $T\left(1\leq T\leq10,000\right)$——The number of the test cases.
For each test case, the only line contains two integers $n,m\left(1\leq n,m\leq10,000,000\right)$ with a white space separated.
输出解释
For each test case, the only line contains a integer that is the answer.
输入样例
2
1 2333333
10 10
输出样例
0
33

提示
In the first test case, obviously $f\left(i,j\right)$ always equals to 0, because $i$ always equals to 1 and $\gcd\left(i,j\right)$ is always a square number(always equals to 1).
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5663

最后修改于 2020-10-25T23:24:37+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
12000/6000MS(Java/Others) 524288/524288K(Java/Others)