#P5307. [COCI 2018/2019 #6] Mobitel
[COCI 2018/2019 #6] Mobitel
Description
He drew a matrix with rows and columns, and each cell contains a positive integer.
He wants to know: if you walk from the top-left corner to the bottom-right corner, and each step can only go right or down to an adjacent cell, how many paths have the product of all numbers on the path not less than ?
Since the answer may be very large, output the result modulo .
Input Format
The first line contains three positive integers .
Next come lines, each containing positive integers, representing the numbers in each row of the matrix in order.
Output Format
Output one line with one integer representing the answer.
2 3 200
2 3 4
5 6 7
2
3 3 90
2 1 1
45 1 1
1 1 1
3
Hint
Sample Explanation:
There are paths in total, among which satisfy the condition:
, with product .
, with product .
Constraints:
For of the testdata:
The numbers in the matrix do not exceed .
For of the testdata:
.
For of the testdata:
.
.
The numbers in the matrix do not exceed .
Translated by ChatGPT 5
京公网安备 11011102002149号