public static void Main()
static void Main(string[] args)
int[] RowsAndCols = Console.ReadLine().Split().Select(int.Parse).ToArray();
int[,] matrix = new int[rows, cols];
for (int r = 0; r < rows; r++)
var line = Console.ReadLine().Split(' ');
foreach (var item in line)
matrix[r, c++] = int.Parse(item);
for (int k = 0; k < rows; k++) d1 += matrix[k,k];
for (int k = 0; k < rows; k++) d2 += matrix[k,rows-k-1];
for (int row = 0; row < rows; row++)
for (int col = 0; col < cols; col++)
if(col > row) s1 += matrix[row,col];
if(col < row) s2 += matrix[row, col];
if (d1 == d2 && s1 % 2 == 0 && s2 % 2 != 0) Console.WriteLine("YES");
for (int k = 0; k < rows; k++)
if (matrix[k, k] % 2 == 0) sd += matrix[k, k];
for (int k = 0; k < cols; k++)
if (matrix[0, k] % 2 == 0) sr += matrix[0, k];
if (matrix[rows-1, k] % 2 == 0) sr += matrix[rows - 1, k];
for (int k = 0; k < rows; k++)
if (matrix[k, 0] % 2 != 0) sc += matrix[k,0];
if (matrix[k, cols - 1] % 2 != 0) sc += matrix[k,cols - 1];
double avr = (s2 + sd + sr + sc) / 4.0;
Console.WriteLine("The amount of money won is: {0:f2}", avr);