def dup_slice(f, m, n, K):
 k = len(f)
 if (k >= m):
  M = (k - m)
 else:
  M = 0
 if (k >= n):
  N = (k - n)
 else:
  N = 0
 f = f[N:M]
 if (not f):
  return []
 else:
  return (f + ([K.zero] * m))

def dup_slice ( f , m , n , K ) : k = len ( f ) if ( k >= m ) : M = ( k - m ) else : M = 0 if ( k >= n ) : N = ( k - n ) else : N = 0 f = f [ N : M ] if ( not f ) : return [ ] else : return ( f + ( [ K . zero ] * m ) )
take a continuous subsequence of terms of f in k[x] .