我还能说什么http://blog.csdn.net/zhhx2001/article/details/52300924
#include<cstdio>
#include<cstring>
#include<iostream>
#define LL long long
using namespace std;
LL n,m;
const LL Mod=998244353ll;
LL phi(LL x){
LL ans=x;
for(LL i=2;i*i<=x;i++)if(x%i==0){
ans=ans/i*(i-1);
while(x%i==0)x/=i;
}
if(x!=1)ans=ans/x*(x-1);
return ans%Mod;
}
int main(){
scanf("%lld%lld",&n,&m);
printf("%lld",n%Mod*(m%Mod)%Mod*phi(n)%Mod*phi(m)%Mod);
return 0;
}