You are given three integers n, m, and k. Consider the following algorithm used to find the maximum element in an array of positive integers:
Initialize maximum_value = -1 and search_cost = 0.
Iterate through each element x in the array arr:
If x is strictly greater than maximum_value, set maximum_value = x and increase search_cost by
Return search_cost.
You need to construct an array arr of length n such that:
Each element arr[i] satisfies arr[i] m for all i n.
Applying the algorithm on arr results in a search_cost equal to k.
Return the total number of valid arrays that can be constructed. Since the answer may be very large, return it modulo
Constraints:
n
m
k n
You are given three integers n, m, and k. Consider the following algorithm used to find the maximum element in an array of positive integers:
Initialize maximum_value = -1 and search_cost = 0.
Iterate through each element x in the array arr:
If x is strictly greater than maximum_value, set maximum_value = x and increase search_cost by
Return search_cost.
You need to construct an array arr of length n such that:
Each element arr[i] satisfies arr[i] m for all i n.
Applying the algorithm on arr results in a search_cost equal to k.
Return the total number of valid arrays that can be constructed. Since the answer may be very large, return it modulo
Constraints:
n
m
k n