Orig Description
Problem H: Count Words
Problem
There are $M$ types of characters. Create a string of length $N$ using these characters. How many strings have at least $K$ different types of characters used in them? Find the answer modulo $998244353$.
Here two strings of length $N$ are considered different if there exists an $i$ $(1 \leq i \leq N)$ such that $S_i \neq T_i$ where $S = S_1S_2 \ldots S_N$ and $T = T_1T_2 \ldots T_N$.
Input
The input is given in the following format:
$M$ $N$ $K$
$M, N,$ and $K$ are given on a single line separated by a single space.
Constraints
The input satisfies the following constraints:
$1 \leq M \leq 10^{18} $
$1 \leq N \leq 10^{18} $
$1 \leq K \leq 1000 $
All input values are integers.
Output
Print the number of strings of length $N$ using $M$ characters such that at least $K$ different types of characters are used. The answer should be printed modulo $998244353$.
Sample Input 1
2 10 1
Sample Output 1
1024
Sample Input 2
1 1 2
Sample Output 2
0
Sample Input 3
5 10 3
Sample Output 3
9755400
Sample Input 4
7 8 3
Sample Output 4
5759460
Sample Input 5
1000000000000000000 1000000000000000000 1000
Sample Output 5
133611974
Extracted Specification
Canonicalized Input Description:
An integer M (1 ≤ M ≤ 10^18), representing some quantity or size.
An integer N (1 ≤ N ≤ 10^18), representing some quantity or size.
An integer K (1 ≤ K ≤ 1000), representing some quantity or size.
### Example Input:
```
2 10 1
```
### Function Signature:
Write a function f(M, N, K) that takes in the input.
```python
def f(M: int, N: int, K: int):
'''
M: an integer
N: an integer
K: an integer
'''
```
Test Case Generator
Certainly! The problem statement you've provided is significantly more complex than the earlier example, primarily due to the very large constraints on \( M \) and \( N \). However, I'll write a test case generator that follows the problem constraints.
Here's the test case generator for "Problem H: Count Words":
```python
import random
def tcgen():
# Generate M in the range [1, 10^18]
M = random.randint(1, 10**18)
# Generate N in the range [1, 10^18]
N = random.randint(1, 10**18)
# Generate K in the range [1, 1000]
K = random.randint(1, 1000)
return M, N, K
# Example usage
for _ in range(5): # Generate 5 test cases
M, N, K = tcgen()
print(f"{M} {N} {K}")
```
This generator will produce valid random test cases according to the constraints specified in the problem statement. When using this generator, keep in mind that \( M \) and \( N \) can be extremely large, so handling them properly in your solution is critical.
Extract Arguments
def extract_arguments(fh):
M, N, K = map(int, fh.readline().strip().split())
return M, N, K