Codeforces Round 230 (Div. 2)
B
Three matrices
Codeforces
未评级
原题
← AC →
翻译中…

Chubby Yang is studying linear equations right now. He came up with a nice problem. In the problem you are given an $*n* × *n*$ matrix $*W*$, consisting of integers, and you should find two $*n* × *n*$ matrices $*A*$ and $*B*$, all the following conditions must hold:

翻译中…
  • $*A*_{*ij*} = *A*_{*ji*}$, for all $*i*, *j*$ $(1 ≤ *i*, *j* ≤ *n*)$;
  • $*B*_{*ij*} = - *B*_{*ji*}$, for all $*i*, *j*$ $(1 ≤ *i*, *j* ≤ *n*)$;
  • $*W*_{*ij*} = *A*_{*ij*} + *B*_{*ij*}$, for all $*i*, *j*$ $(1 ≤ *i*, *j* ≤ *n*)$.
翻译中…

Can you solve the problem?

翻译中…

Input

翻译中…

The first line contains an integer $*n*$ $(1 ≤ *n* ≤ 170)$. Each of the following $*n*$ lines contains $*n*$ integers. The $*j*$-th integer in the $*i*$-th line is $*W*_{*ij*}$ $(0 ≤ |*W*_{*ij*}| < 1717)$.

翻译中…

Output

翻译中…

The first $*n*$ lines must contain matrix $*A*$. The next $*n*$ lines must contain matrix $*B*$. Print the matrices in the format equal to format of matrix $*W*$ in input. It is guaranteed that the answer exists. If there are multiple answers, you are allowed to print any of them.

翻译中…

The answer will be considered correct if the absolute or relative error doesn't exceed $10^{ - 4}$.

翻译中…

样例

Input #1
2
1 4
3 2
Output #1
1.00000000 3.50000000
3.50000000 2.00000000
0.00000000 0.50000000
-0.50000000 0.00000000
InputCopy OutputCopy
Input #2
3
1 2 3
4 5 6
7 8 9
Output #2
1.00000000 3.00000000 5.00000000
3.00000000 5.00000000 7.00000000
5.00000000 7.00000000 9.00000000
0.00000000 -1.00000000 -2.00000000
1.00000000 0.00000000 -1.00000000
2.00000000 1.00000000 0.00000000
InputCopy OutputCopy
题目信息
题号
393B
时间限制
1 s
内存限制
256 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。