Create Hw4matrixmult



a1 a2 a3 · · · an
a2 a1 a2 · · · an−1
a3 a2 a1 · · · an−2
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
an an−1 an−2 · · · a1


Write a C++ program matMult.cpp which, given a sequences of non-negative integers a1, a2, . . . , an,
where n ≤ 10, 000, and three positive integers k, i and j, computes and prints the last four digits
(omit leading zeros, prints 0 if all zeros, i.e., the same requirement as Homework #2 Problem 3) of
the (i, j)-th element of the k-th power of the following n × n matrix:

Your program should get its input from cin. The input is a sequence of integers in the order of
k, i, j, a1, a2, . . . , an. Please note that you may not even have enough memory to store the entire
matrix if n is large. Example runs of valid input arguments are (the first line is the command line,
the second line is the input and the third line is the expected output of your program).