mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 18:11:59 +00:00
parent
15d6baf0e1
commit
08a11da9c6
24
S2OJ/473/473.cpp
Normal file
24
S2OJ/473/473.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user