Given matrix szie N. There is a need to create square matrix, filled by increasing numbers from 1 to some K in spiral way from the center N/2.
 
Test set 1
Result:
 
Test set 2
Result:
 
Test set 3
Result:
 
Test set 4
Result:
 
Test set 5
Result:
 
Test set 6
Result:
 
Test set 7
Result: