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

建议使用的浏览器:

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

6390:GuGuFishtion

题目描述
Today XianYu is too busy with his homework, but the boring GuGu is still disturbing him!!!!!!
At the break time, an evil idea arises in XianYu's mind.
‘Come on, you xxxxxxx little guy.’
‘I will give you a function $\phi(x)$ which counts the positive integers up to $x$ that are relatively prime to $x$.’
‘And now I give you a fishtion, which named GuGu Fishtion, in memory of a great guy named XianYu and a disturbing and pitiful guy GuGu who will be cooked without solving my problem in 5 hours.’
‘The given fishtion is defined as follow:
$$G_u (a,b)=\frac{\phi(ab)}{\phi(a)\phi(b)}$$
And now you, the xxxxxxx little guy, have to solve the problem below given $m$,$n$,$p$.’
$$(\sum\limits_{a=1}^m\sum\limits_{b=1}^nG_u (a,b))\pmod p$$
So SMART and KINDHEARTED you are, so could you please help GuGu to solve this problem?
‘GU GU!’ GuGu thanks.
输入解释
Input contains an integer $T$ indicating the number of cases, followed by $T$ lines. Each line contains three integers $m$,$n$,$p$ as described above.
$1\le T\le 3$
$1\le m,n\le 1,000,000$
$\max(m,n)<p\le 1,000,000,007$
And given $p$ is a prime.
输出解释
Please output exactly $T$ lines and each line contains only one integer representing the answer.
输入样例
1
5 7 23
输出样例
2
来自杭电HDUOJ的附加信息
Recommend chendu

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

源链接: HDU-6390

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

共提交 0

通过率 --%
时间上限 内存上限
3000/1500MS(Java/Others) 65536/65536K(Java/Others)