#P5572. Totient Sum of LCM and GCD Ratio

    ID: 18802 Type: Default 1000ms 256MiB

Totient Sum of LCM and GCD Ratio

Totient Sum of LCM and GCD Ratio

Given two positive integers n and m, compute the following expression modulo 23333:

\[ S = \sum_{i=1}^{n} \sum_{j=1}^{m} \varphi\left(\frac{\mathrm{lcm}(i,j)}{\gcd(i,j)}\right) \bmod 23333 \]

Here, \(\varphi(x)\) denotes Euler's totient function. The least common multiple and greatest common divisor of i and j are denoted by \(\mathrm{lcm}(i,j)\) and \(\gcd(i,j)\) respectively.

The value \(\frac{\mathrm{lcm}(i,j)}{\gcd(i,j)}\) can also be computed by \(\frac{i \times j}{\gcd(i,j)^2}\). Your task is to calculate \(S\) modulo 23333.

inputFormat

The input consists of a single line containing two positive integers n and m separated by a space.

Constraints are unspecified, but the provided test cases use small values.

outputFormat

Output a single integer which is the value of the expression computed modulo 23333.

sample

1 1
1