PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000230. Đếm dãy theo tích các phần tử (Multiplicative Arrays)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đếm dãy theo tích các phần tử (Multiplicative Arrays)
Multiplicative Arrays
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
You are given two positive integers and . For every integer from through , count the integer arrays satisfying:
- The length lies between and , inclusive.
- Every entry obeys .
- The product equals .
Arrays of different lengths, or differing at any position, are distinct. Arrays consisting only of s are included. Print the counts for , modulo .
Input
The only line contains two integers .
Output
Print exactly integers in increasing order of : the count for product modulo .
Subtasks
-
Subtask 1 (20 points): ; .
-
Subtask 2 (30 points): ; .
-
Subtask 3 (50 points): ; .
Examples
Input
2 2
Output
2 3
Explanation
For , all entries are or , and lengths are or . Product has the arrays and . Product has , , and . The output is therefore .