fac(n,d)=prod(k=0,(n-1)\d,n-k*d) for(k=1,5,for(n=1,10,print1(fac(n,k)" "));print)