using System; namespace Rextester { public class Program { public static void Main(string[] args) { int [,] a = new int [6,6] { {27, 29, 2, 4, 13, 36}, { 9, 11, 20, 22, 31, 18}, {32, 25, 7, 3, 21, 23}, {14, 16, 34, 30, 12, 5}, {28, 6, 15, 17, 26, 19}, { 1, 24, 33, 35, 8, 10}}; int [] r = new int [6] {0,0,0,0,0,0}; int [] l = new int [6] {0,0,0,0,0,0}; int [] d = new int [2] {0,0}; int j,k, n=6; for (j = 0; j