User's AC Ratio

100.0% (1/1)

Submission's AC Ratio

33.3% (2/6)

Tags

Description

計算有幾個不同的數列 $a_1, a_2, \cdots , a_n$ 滿足 $\gcd(a_1, a_2, \cdots , a_n) = x$ 且 $\sum\limits_{i=1}^n{a_i} = y$
由於計算結果可能非常大,請將結果除以 $(10^9 + 7)$ 取餘數再輸出

Input Format

給定兩個正整數 $x, y$ $(1\le x, y \le 10^9)$

Output Format

計算有幾個滿足題敘條件的數列
將結果除以 $(10^9 + 7)$ 取餘數再輸出

Sample Input 1

2 12

Sample Output 1

27

Sample Input 2

4 7

Sample Output 2

0

Hints

$\gcd(a_1, a_2, \cdots , a_n) $ 表示 $a_1, a_2, \cdots , a_n$ 相同的因數中最大的因數

Problem Source

Codeforces 900D Unusual Sequences

Subtasks

No. Testdata Range Score
1 0~46 100

Testdata and Limits

No. Time Limit (ms) Memory Limit (KiB) Output Limit (KiB) Subtasks
0 1000 65536 65536 1
1 1000 65536 65536 1
2 1000 65536 65536 1
3 1000 65536 65536 1
4 1000 65536 65536 1
5 1000 65536 65536 1
6 1000 65536 65536 1
7 1000 65536 65536 1
8 1000 65536 65536 1
9 1000 65536 65536 1
10 1000 65536 65536 1
11 1000 65536 65536 1
12 1000 65536 65536 1
13 1000 65536 65536 1
14 1000 65536 65536 1
15 1000 65536 65536 1
16 1000 65536 65536 1
17 1000 65536 65536 1
18 1000 65536 65536 1
19 1000 65536 65536 1
20 1000 65536 65536 1
21 1000 65536 65536 1
22 1000 65536 65536 1
23 1000 65536 65536 1
24 1000 65536 65536 1
25 1000 65536 65536 1
26 1000 65536 65536 1
27 1000 65536 65536 1
28 1000 65536 65536 1
29 1000 65536 65536 1
30 1000 65536 65536 1
31 1000 65536 65536 1
32 1000 65536 65536 1
33 1000 65536 65536 1
34 1000 65536 65536 1
35 1000 65536 65536 1
36 1000 65536 65536 1
37 1000 65536 65536 1
38 1000 65536 65536 1
39 1000 65536 65536 1
40 1000 65536 65536 1
41 1000 65536 65536 1
42 1000 65536 65536 1
43 1000 65536 65536 1
44 1000 65536 65536 1
45 1000 65536 65536 1
46 1000 65536 65536 1