atcoder#ABC162E. [ABC162E] Sum of gcd of Tuples (Hard)
[ABC162E] Sum of gcd of Tuples (Hard)
Score : points
Problem Statement
Consider sequences of length consisting of integers between and (inclusive).
There are such sequences. Find the sum of over all of them.
Since this sum can be enormous, print the value modulo .
Here denotes the greatest common divisor of .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the sum of over all sequences, modulo .
3 2
9
Thus, the answer is .
3 200
10813692
100000 100000
742202979
Be sure to print the sum modulo .