All submissions for this problem are available.It's first class of Maths-101 where teacher want to teach students how to add square matrices. Students want to skip the topic so they tell teacher that they already know the way to perform such task. Teacher got angry and she gave them a task of calculating $C_1*A$ + $C_2*A$ ... + $C_N*A$ given a matrix $A$ of order 3 and an array $C$ for which $C_i$ is $(N-i+1)$. Teacher can set N to be very large, hence it's really hard to compute it by scribbling. Since you're the topper of your class you must save your classmates by solving this and forwarding it to your group. ###Input: - First line will contain number of test cases $T$. - First line of each test case will contain an integer $N$. - Next three lines will contain three rows of matrix $A$, where each line will contain three space separated integers. ###Output: For each testcase, output three lines where each line represents one row of the resultant matrix and each row contains three space separated integers. ###Constraints - $1 \leq T \leq 10^5$ - $1 \leq N \leq 10^5$ - value of each element of A will be in between 1 and 10^3 ###Sample Input: 1 1 1 1 1 1 1 1 1 1 1 ###Sample Output: 1 1 1 1 1 1 1 1 1 ###EXPLANATION: Just one test case for which the matrix $A$ is [ [1,1,1], [1,1,1], [1,1,1] ] and for N=1 array C will be  hence resultant matrix will be $C_1*A$ which is same as input matrix.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.