def factorialk(n, k, exact=True):
 if exact:
  if (n < (1 - k)):
   return 0
  if (n <= 0):
   return 1
  val = 1
  for j in xrange(n, 0, (- k)):
   val = (val * j)
  return val
 else:
  raise NotImplementedError

def factorialk ( n , k , exact = True ) : if exact : if ( n < ( 1 - k ) ) : return 0 if ( n <= 0 ) : return 1 val = 1 for j in xrange ( n , 0 , ( - k ) ) : val = ( val * j ) return val else : raise NotImplementedError
multifactorial of n of order k .