单点时限: 2.0 sec
内存限制: 1024 MB
Cuber QQ is now studying Cuber Matrix. Cuber Matrix is a
Cuber QQ finds some interesting numbers in the matrix called Peak Numbers. Peak Numbers are those numbers that are larger than all the other numbers around them (8 directions).
Now, Cuber QQ wants you to construct two Cuber Matrixs such that the number of Peak Numbers in the matrix is minimized or maximized.
The first line consists of two integers —
The first line consists of two integers, denoting the minimum and maximum possible number of the Peak Numbers in a
In the next
The next
4 4
1 4 7 8 9 10 4 5 6 11 1 2 3 16 12 13 14 15 4 1 7 8 2 3 10 12 5 6 11 9 14 13 16 15
In the minimum case,
In the maximum case,