Description
Input
输入文件的第一行输入两个正整数 。
Output
如题
Sample Input
5 6
Sample Output
240
HINT
N,M<=10^15
题解
http://blog.csdn.net/popoqqq/article/details/46820313
http://blog.csdn.net/zhhx2001/article/details/52300924
代码
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<cstring>
typedef long long ll;
using namespace std;
inline int read()
{
int x=0;char ch=getchar();
while (ch<'0'||ch>'9') ch=getchar();
while (ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
return x;
}
ll n,m,mod=998244353;
ll phi(ll n)
{
ll ans=n;
for (ll i=2LL;i*i<=n;i++)if (n%i==0)
{
while (n%i==0) n/=i;
ans=ans/i*(i-1);
}
if (n>1) ans=ans/n*(n-1);
return ans;
}
int main()
{
scanf("%lld%lld",&n,&m);
printf("%lld",phi(n)%mod*(phi(m)%mod)%mod*(n%mod)%mod*(m%mod)%mod);
return 0;
}