Joshephus or MamakoDate Sequence EASY by inaniwa

m;n;i;main(t){for(;i++?:~scanf("%d%d",&m,&n);printf(i/m?i=0,"%d\n":"%d ",t))for(t=n*i;t>m;t/=n-1)t=n*(t-m)-1;}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page