-1
APL(NARS), 104 chars, 208 bytes
i←{⍵>0:⍳⍵⋄0,⍨⌽-⍳∣⍵}
R←{0>⍵-⍺:⍬⋄⍺>0:(i⍵)∼i⍺-1⋄1=×⍵×⍺:(i⍺)∼i⍵+1⋄(i⍺)∪i⍵}
f←{⍺≤⍵:⍺⍵,¯1↓1↓⍺R⍵⋄⍺⍵,⌽¯1↓1↓⍵R⍺}
This is a try using one alternative iota and range function for see if exercise would be easy as the range and iota function use Nars APL. Test for the iota l...