S. 10. Write a program that fills out a 3×3 magic square if some of its entries are given. (A magic square is a square array of numbers such that the sum of numbers in any horizontal, vertical and main diagonal line is always the same number.)
The program should read the initial state of the square from the standard input. Entries of the square will be given in three lines and separated by spaces. The numbers given in advance will be integers having at most 3 digits, while unspecified entries will be denoted by an X. Your program should display the resulting magic square in the same format on the standard output. Fractions in the output should be rounded to two decimal places.
It is of course possible that the given numbers are inconsistent and the magic square can not be completed. In this case your program should report ``No solution''. Similarly, it may happen that there are more than one (even infinitely many) solutions. In such cases the program should choose and display one possible solution and issue a warning ``The solution is not unique'' in the next line.
Deadline expired on 17 October 2005.