#P10182. 一径入繁华

    ID: 11485 远端评测题 2000ms 512MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>数学数论洛谷原创O2优化线性代数洛谷月赛

一径入繁华

Background

Along with the Year of the Dragon, there comes the nine-province joint mock exam that Fanju really likes. In order to completely crush the final problem, Fanju seriously reviewed number theory again.

Where number theory is born, there lies a land of prosperity.

Problem Description

Fanju thinks computing the value of xax^a modulo pp is too easy, so he wants to compute the value of σ0s(xt)\sigma_0^s(x^t) modulo pp.

Fanfan is not satisfied with computing it only once, so he wrote an n×nn\times n number table AA, guaranteeing that the element ai,ja_{i,j} in row ii and column jj (1i,jn1\le i,j\le n) satisfies:

$$a_{i,j}=\sum_{d\mid \gcd(i,j)}\mu\left(\dfrac{\gcd(i,j)}{d}\right)\times (\sigma_0(d^s))^t$$

Fanfan wants to know what this number table looks like, but it is far too large. So please tell him the value of detA\det A modulo 109+710^9+7.

Notes:

  1. The meanings of the functions in the expression are explained here (μ\mu denotes the Möbius function, and σ0\sigma_0 denotes the divisor-counting function).
  2. detA\det A denotes the determinant of the square matrix AA.

Input Format

One line with three integers n,s,tn,s,t.

Output Format

One line with one integer representing the answer.

2 1 2
2
2 3 4
254
19 8 10
913255725
10000000000 1 2
880793261

Hint

Sample 11 Explanation

Matrix AA is:

[1113]\begin{bmatrix} 1 & 1\\ 1 &3 \end{bmatrix}

Its determinant is 1×31×1=21\times 3 - 1\times 1=2.

Sample 22 Explanation

Matrix AA is:

[111255]\begin{bmatrix} 1 & 1\\ 1 & 255 \end{bmatrix}

Its determinant is 1×2551×1=2541\times 255 - 1 \times 1=254.

Constraints

This problem uses bundled subtasks.

For 100%100\% of the testdata, it is guaranteed that 1n10111\le n\le 10^{11}, 0s,t<109+70\le s,t< 10^9+7.

Subtask ID nn Special Property Score
Subtask #1 500\le 500 None 88
Subtask #2 107\le 10^7 s=1,t=2s=1,t=2 55
Subtask #3 s=1s=1 1010
Subtask #4 1011\le 10^{11} s=1,t=2s=1,t=2
Subtask #5 s=1s=1
Subtask #6 t=1t=1 22
Subtask #7 107\le 10^{7} t9t\le 9 1010
Subtask #8 1011\le 10^{11} 1515
Subtask #9 107\le 10^7 None 1010
Subtask #10 1011\le 10^{11} 2020

If the “Special Property” column is empty, it means there is no special property. For variables whose ranges are not specified in a subtask, their values are generated within [0,109+7)[0,10^9+7).

Time limit: 2000 ms\text{2000 ms}.

Memory limit: 512 MB\text{512 MB}.

Translated by ChatGPT 5