QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 256 MB 満点: 100

#8626. distance

統計

Let $N = p_1^{e_1} \cdot p_2^{e_2} \cdot \dots \cdot p_n^{e_n}$, where $p_i$ are distinct prime numbers. Find:

  1. The number of ways to represent $N$ as a product of $k$ numbers, i.e., $N = a_1 \cdot a_2 \cdot \dots \cdot a_k$. Find the number of distinct tuples $(a_1, a_2, \dots, a_k)$.

  2. The number of ways to represent $N$ as a product of $k$ strictly increasing numbers, i.e., $N = a_1 \cdot a_2 \cdot \dots \cdot a_k$ where $a_1 < a_2 < \dots < a_k$. Find the number of distinct tuples $(a_1, a_2, \dots, a_k)$.

  3. The number of ways to represent $N$ as a product of $k$ non-decreasing numbers, i.e., $N = a_1 \cdot a_2 \cdot \dots \cdot a_k$ where $a_1 \le a_2 \le \dots \le a_k$. Find the number of distinct tuples $(a_1, a_2, \dots, a_k)$.

The answers should be taken modulo $10^9 + 7$.

Input

The first line contains two integers $n$ and $k$.

The next line contains $n$ integers, $e_1, e_2, \dots, e_n$.

Output

Output three lines, each containing the answer to the corresponding question.

Constraints

  • 10%, $n \le 10, e_i \le 10, k \le 2$
  • 20%, $n \le 30, e_i \le 30, k \le 10$
  • 10%, $n \le 30, e_i \le 30, k \le 20$
  • 20%, $n \le 10000, e_i \le 10000, k \le 5$
  • 20%, $n \le 10000, e_i \le 10000, k \le 15$
  • 10%, $n \le 10000, e_i \le 10000, k \le 20$
  • 10%, $n \le 10000, e_i \le 10000, k \le 25$

Examples

Input 1

5 3
3 4 2 5 1

Output 1

56700
9432
9468

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.