Orig Description
B: Ebi-chan and Integer Sequences -
Problem
Ebi-chan likes integer sequences, especially arithmetic sequences.
This time, she decided to create a sequence that satisfies the following conditions:
It is an arithmetic sequence of length n.
When the i-th element of the sequence is denoted by s_i, all s_i (1 \leq i \leq n) are integers satisfying 0 \leq s_i \leq m.
How many arithmetic sequences can be created that satisfy the above conditions?
Since the answer can be very large, output it modulo 10^9 + 7.
Input Format
The input is given in a single line.
n m
n represents the length of the sequence.
Constraints
1 \leq n \leq 10^{15}
0 \leq m \leq 10^{15}
Output Format
Output the number of arithmetic sequences that satisfy the above conditions, modulo 10^9 + 7.
Sample Input 1
3 9
Sample Output 1
50
Sample Input 2
10000000000 10000000000
Sample Output 2
999999942
Note that the input may not fit in a 32-bit integer.
Extracted Specification
An integer n (1 ≤ n ≤ 10^15), representing some quantity or size.
An integer m (0 ≤ m ≤ 10^15), representing some other quantity or size.
### Example Input:
```
3 9
```
### Function Signature:
Write a function f(n, m) that takes in the input.
def f(n: int, m: int):
'''
n: an integer
m: an integer
'''
Test Case Generator
To create a test case generator for the problem "Ebi-chan and Integer Sequences," we need to generate values for \( n \) and \( m \) within their specified constraints. Here's a Python function that generates random test cases for this problem:
```python
import random
def tcgen():
# Generate n in the range from 1 to 10^15
n = random.randint(1, 10**15)
# Generate m in the range from 0 to 10^15
m = random.randint(0, 10**15)
return n, m
# Example usage:
n, m = tcgen()
print(n, m)
```
This function generates a random integer \( n \) between 1 and \( 10^{15} \) and a random integer \( m \) between 0 and \( 10^{15} \). These values will be used as inputs for the problem statement.
To ensure the function works correctly, you can run the example usage which will print one set of generated test inputs to verify their correctness.
Please note that this test case generator can generate very large values, so ensure your environment can handle such large integers before running it.
Extract Arguments
def extract_arguments(fh):
n, m = map(int, fh.readline().strip().split())
return n, m