Joshephus or MamakoDate Sequence EASY by teebee

import java.util.*;enum J{J;System z;int a[]=new int[99],i,j,k,l,m,n;{for(Scanner s=new Scanner(z.in);++l>0;i=j=0)for(k=m=s.nextInt(),n=s.nextInt();k>0;)if(a[i=i%m+1]<l&&++j%n<1)z.out.print(i+(--k*(a[i]=l)>0?" ":"\n"));}}

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

download

return to the top page