Characterize a sub-square shape as an arranged pair of two cells ((x1,y1),(x2,y2)), indicating the upper left cell and base right cell (comprehensively) of a sub-square shape in a. Two sub-square shapes ((x1,y1),(x2,y2)) and ((x3,y3),(x4,y4)) have a similar example if and provided that the accompanying holds: they have a similar width (x2−x1=x4
Please proper code and output screenshot else downvoted.
Characterize a sub-square shape as an arranged pair of two cells ((x1,y1),(x2,y2)), indicating the upper left cell and base right cell (comprehensively) of a sub-square shape in a. Two sub-square shapes ((x1,y1),(x2,y2)) and ((x3,y3),(x4,y4)) have a similar example if and provided that the accompanying holds: they have a similar width (x2−x1=x4−x3); they have a similar tallness (y2−y1=y4−y3); for each pair (i,j) where 0≤i≤x2−x1 and 0≤j≤y2−y1, the shade of cells (x1+i,y1+j) and (x3+i,y3+j) are equivalent.
Count the number of conceivable batik shading mixes, with the end goal that the subrectangles ((ax,ay),(ax+r−1,ay+c−1)) and ((bx,by),(bx+r−1,by+c−1)) have a similar example. Output the appropriate response modulo 109+7.
Input : The primary line contains five integers n, m, k, r, and c (1≤n,m≤109, 1≤k≤109, 1≤r≤min(106,n), 1≤c≤min(106,m)) — the size of the batik, the number of tones, and size of the sub-square shape. The subsequent line contains four integers hatchet, ay, bx, and by (1≤ax,bx≤n, 1≤ay,by≤m) — the upper left corners of the first and second sub-square shape. Both of the sub-square shapes given are inside the framework (1≤ax+r−1, bx+r−1≤n, 1≤ay+c−1, by+c−1≤m).
Output :Output an integer signifying the number of conceivable batik shading mixes modulo 109+7.
Step by step
Solved in 4 steps with 1 images