No.1781 LCM
タグ : / 解いたユーザー数 16
作問者 :
testestest
Problem Statement
You are given positive integers $N,M$.
Find the sum of $\displaystyle \left\lfloor \frac{M}{{\rm lcm}(A)}\right\rfloor$ over all sequences $A$ of length $N$ whose elements are all positive integers, modulo $998244353$.
Here, ${\rm lcm}(A)$ is the smallest positive integer that has every element of $A$ as a divisor.
Input
$N$ $M$
$1\leq N \leq 10^{11}$
$1\leq M \leq 10^{11}$
There are 32 test cases. Of these, 16 satisfy $N,M \leq 2\times 10^5$. (Around ★3)
Output
Output the answer.
Sample
Sample 1
Input
3 2
Output
9
There are $7$ sequences for which $\displaystyle \left\lfloor \frac{M}{{\rm lcm}(A)}\right\rfloor$ equals $1$, and $1$ sequence for which it equals $2$.
Sample 2
Input
3 4
Output
44
There are $26$ sequences for which $\displaystyle \left\lfloor \frac{M}{{\rm lcm}(A)}\right\rfloor$ equals $1$, $7$ sequences for which it equals $2$, and $1$ sequence for which it equals $4$.
Sample 3
Input
200000 200000
Output
68905
Find the answer modulo $998244353$.
Sample 4
Input
100000000000 100000000000
Output
369470795
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。