0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

#473. 简单的数学题

https://sjzezoj.com/submission/13575
This commit is contained in:
Baoshuo Ren 2021-07-10 16:24:55 +08:00 committed by Baoshuo Ren
parent 15d6baf0e1
commit 08a11da9c6
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

24
S2OJ/473/473.cpp Normal file
View File

@ -0,0 +1,24 @@
#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
long long n, m;
long long phi(long long x) {
long long ans = x;
for (long long i = 2; i * i <= x; i++)
if (x % i == 0) {
ans = ans / i * (i - 1);
while (x % i == 0) x /= i;
}
if (n > 1) ans = ans / x * (x - 1);
return ans;
}
int main() {
scanf("%lld%lld", &n, &m);
printf("%lld\n", (long long)(n % mod) * (m % mod) % mod * (phi(n) % mod) % mod * (phi(m) % mod) % mod);
return 0;
}