Perfect Squares Without Borders Given n=m^2, return a list of integers that do not border the m x m grid of integers from 1 to n.

Examples

n=1 (m=1)

Grid:

[1]


Return:

[]


n=4 (m=2)

Grid:

[1,2]
[3,4]


Return:

[]


n=9 (m=3)

Grid:

[1,2,3]
[4,5,6]
[7,8,9]


Return:

[5]


n=16 (m=4)

Grid:

[ 1, 2, 3, 4]
[ 5, 6, 7, 8]
[ 9,10,11,12]
[13,14,15,16]


Return:

[6,7,10,11]




For higher values of m, this answer does a great visualization.



Rules:


You may take in either m or n (where n = m*m).


If taking in n you are allowed to have undefined behavior where there exists no m for n (E.G. 15).
n &gt; 0, m &gt; 0: Both must be integer values.

The output may be as a 1D/2D array, matrix or whitespace delimited 
The output must be in order from least to greatest.


If outputting as a matrix this means it must be as it would be in the grid.

This is code-golf, lowest byte-count wins.
C, 50 bytes



i;f(m){for(i=m;++i&lt;m*m-m;)i%m&gt;1&amp;&amp;printf("%d ",i);}


Try it online!