問題一覧 > 通常問題

No.1781 LCM

レベル : / AI推定難易度 : 2650 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 16
作問者 : testestest
お気に入りにしたユーザー ProblemId : 7317 / 自分の提出
問題文最終更新日: 2021-12-25 23:44:05
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Advent Calendar Contest 2021 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。