Matrix Reloaded |
Moni is a brilliant student of BUET. After the last class of the current term (semester) he decided to watch the renowned film of the year 2003 "MATRIX RELOADED" that was displayed in the BUET AUDITORIUM. Yet he could not forget it. He became so much enthusiastic about the subject of Mathematics "Matrix" that he decided to make a computer version of every program of Matrix. As it is a huge subject he wants your help. Please write a program that calculates the inverse of a matrix.
The input consists of several cases. Each case consists of a matrix. Consecutive cases are separated by a black line. Each element of the matrices given are separated from other members by spaces. The first line for each case is a number ,n, giving the order of the matrix. Input is terminated by a value of n=0.
For each case your program should 1) if possible calculate the inverse of the matrix and print it with members of same row separated by a space and columns are printed in separate line 2) otherwise print a line Not possible . Print a black line after each test cases. I think you all know that a singular matrix has no inverse matrix. No pivoting is allowed. For output format see the sample output.
2 1 2 2 1 2 1 2 2 1 0
-0.333333 0.666667 0.666667 -0.333333 -0.333333 0.666667 0.666667 -0.333333
Anupam Bhattacharjee ( BUET PESSIMISTIC )