Given a matrix of natural numbers, a natural number and a natural number , compute . To avoid overflows, compute every element of .
Input consists of several cases, each with , , and in this order, followed by and . Assume that the elements of are not larger than , , and .
For every case, print the elements of in two lines following the format of the sample. Print a line with 10 dashes after every matrix.
Author: Salvador Roura
Generation: 2026-01-25T11:10:48.171Z
© Jutge.org, 2006–2026.
https://jutge.org