AtCoder Beginner Contest 236
Ex
Distinct Multiples
AtCoder
⌀ 2898
原题
←G →
翻译中…

Problem Statement

翻译中…

Given are positive integers $N$, $M$, and a sequence of positive integers $D = (D_1, \dots, D_N)$.

翻译中…

Find the number of sequences of positive integers $A = (A_1, \dots, A_N)$ that satisfy the following conditions, modulo $998244353$.

翻译中…
  • $1 \leq A_i \leq M \, (1 \leq i \leq N)$
  • $A_i \neq A_j \, (1 \leq i \lt j \leq N)$
  • For each $i \, (1 \leq i \leq N)$, $A_i$ is a multiple of $D_i$.
翻译中…

Constraints

翻译中…
  • $2 \leq N \leq 16$
  • $1 \leq M \leq 10^{18}$
  • $1 \leq D_i \leq M \, (1 \leq i \leq N)$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N M
D_1 \ldots D_N

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
3 7
2 3 4
Output #1
3
The three sequences $A$ that satisfy the conditions are $(2, 3, 4), (2, 6, 4), (6, 3, 4)$.
Input #2
3 3
1 2 2
Output #2
0
No sequence $A$ satisfies the conditions.
Input #3
6 1000000000000000000
380214083 420492929 929717250 666796775 209977152 770361643
Output #3
325683519
Be sure to find the count modulo $998244353$.
题目信息
题号
abc236_h
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。