2 3 0 1 0 2
0 2
1 2
$B^p$ for all possible $B$ are as follows:
* $\begin{pmatrix}1&1 \\ 1&2\end{pmatrix}^3=\begin{pmatrix}5&8 \\ 8&13\end{pmatrix}$
* $\begin{pmatrix}1&1 \\ 2&2\end{pmatrix}^3=\begin{pmatrix}9&9 \\ 18&18\end{pmatrix}$
* $\begin{pmatrix}2&1 \\ 1&2\end{pmatrix}^3=\begin{pmatrix}14&13 \\ 13&14\end{pmatrix}$
* $\begin{pmatrix}2&1 \\ 2&2\end{pmatrix}^3=\begin{pmatrix}20&14 \\ 28&20\end{pmatrix}$
Print each element, modulo $p=3$, of their sum $\begin{pmatrix}48&44 \\ 67&65\end{pmatrix}$.3 2 1 0 0 0 1 0 0 0 1
1 1 1
1 1 1
1 1 1
$B^p$ for all possible $B$ are as follows:
* $\begin{pmatrix}1&1&1 \\ 1&1&1 \\ 1&1&1\end{pmatrix}^2=\begin{pmatrix}3&3&3\\3&3&3\\3&3&3\end{pmatrix}$
Print each element, modulo $p=2$, of their sum $\begin{pmatrix}3&3&3\\3&3&3\\3&3&3\end{pmatrix}$.4 13 0 1 2 0 3 4 0 5 0 6 0 7 8 9 0 0
8 0 6 5 11 1 8 5 8 0 4 12 8 0 1 9
{
"problem": {
"name": "Matrix Pow Sum",
"description": {
"content": "You are given a prime number $p$ and an $N \\times N$ matrix $A = (A_{i,j})$ ($1\\leq i,j\\leq N$). Each element of $A$ is an integer between $0$ and $p-1$, inclusive. Consider a matrix $B$ obtained by r",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc190_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a prime number $p$ and an $N \\times N$ matrix $A = (A_{i,j})$ ($1\\leq i,j\\leq N$). Each element of $A$ is an integer between $0$ and $p-1$, inclusive.\nConsider a matrix $B$ obtained by r...",
"is_translate": false,
"language": "English"
}
]
}