DescriptionInputOutputSample Input8 8 0 0 5 6 4 3 7 7 3 4 3 2 6 6 5 1 6 7 1 3 6 3 5 7 2 2 3 0 0 7 5 1 5 3 6 3 3 2 6 4 2 4 6 2 5 6 5 1 6 2 2 1 5 4 3 3 5 7 6 5 7 0 6 5 Sample Output12133 HintSourcePku 3609