n=readline(x=l=i=0) y=u=n-1 for(s='';n--;x=i++%2?++l:--u)for(j=n-~n;j--;i%2?x>l?x--:y+=y<u:x<u?x++:y-=y>l)s=s+x+y+' ' print(s)
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page