Under construction

Still being built. Things may change

Möbius Madness

Time limit2.5sMemory limit512 MB

Summary
Given N, L, and K, compute the sum over d from 1 to N of mu(L*d) times floor(N/d) to the power K, modulo 1e9+7.
Level

Hard8 of 10

Topics
Math, Number theory, Divide and conquer
Solved
No attempts yet

Problem

The Möbius function μ(n)\mu(n) is one of the important multiplicative functions in number theory.

For a positive integer nn, μ(n)\mu(n) is defined as follows.

  • If nn is squarefree and has kk prime factors, then μ(n)=(−1)k\mu(n)=(-1)^k. In particular, μ(1)=1\mu(1)=1.
  • If nn is not squarefree, then μ(n)=0\mu(n)=0.

Given positive integers NN, LL, and KK, compute the following value. Since the value can be large, print it modulo 109+710^9+7.

∑d=1Nμ(L⋅d)⌊Nd⌋K\sum_{d=1}^N \mu(L \cdot d) \left\lfloor \frac{N}{d} \right\rfloor^K

Input

The input is a single line containing the positive integers NN, LL, and KK, in that order.

The input satisfies 1≤N≤1091 \le N \le 10^9, 1≤L≤10151 \le L \le 10^{15}, and 1≤K≤1091 \le K \le 10^9.

Output

Print the value of the sum above modulo 109+710^9+7.

Examples3

  1. Example 1

    Input
    100 1 1
    Expected output
    1
  2. Example 2

    Input
    100 30 10
    Expected output
    44609703
  3. Example 3

    Input
    100 4 100
    Expected output
    0