Let f(x,y) be the lowest common multiple of x and y and g(x,y) be the greatest common divisor of x and y. Determine ∑x=1N∑y=1Nf(x,y)×g(x,y)2 modulo a prime number, K.
The only line will contain two space-separated integers, N (1≤N≤1010) and K (2≤K≤2×109).
Output ∑x=1N∑y=1Nf(x,y)×g(x,y)2 modulo K.
10 131
64
There are no comments at the moment.
Comments