QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 1024 MB 總分: 100

#3740. 2018

统计

Bobo wants to count the number of matrices $A$ that satisfy the following conditions:

  1. Matrix $A$ has $n$ rows and $m$ columns, and every element is a positive integer. The element in the $i$-th row and $j$-th column is denoted by $A_{i, j}$.
  2. $A_{1, 1} = 2018$.
  3. For all $2 \leq i \leq n, 1 \leq j \leq m$, $A_{i, j}$ is a divisor of $A_{i - 1, j}$.
  4. For all $1 \leq i \leq n, 2 \leq j \leq m$, $A_{i, j}$ is a divisor of $A_{i, j - 1}$.

Since the number of such matrices $A$ can be very large, Bobo only wants to find the number of such matrices modulo $(10^9+7)$.

Input

The input contains multiple test cases. Process until the end of the file.

Each test case contains two integers $n$ and $m$.

Output

For each test case, output one integer representing the number of such matrices modulo $(10^9+7)$.

Examples

Input 1

1 1
1 2
2 2
2 3
2000 2000

Output 1

1
4
25
81
570806941

Note

For the second test case ($n = 1, m = 2$), the matrices $A$ that satisfy the conditions are $(2018, 2018), (2018, 1009), (2018, 2), (2018, 1)$, totaling $4$ possibilities.

Constraints

  • $1 \leq n, m \leq 2000$
  • The number of test cases does not exceed $10^5$.

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.