def _dup_ff_trivial_gcd(f, g, K):
 if (not (f or g)):
  return ([], [], [])
 elif (not f):
  return (dup_monic(g, K), [], [dup_LC(g, K)])
 elif (not g):
  return (dup_monic(f, K), [dup_LC(f, K)], [])
 else:
  return None

def _dup_ff_trivial_gcd ( f , g , K ) : if ( not ( f or g ) ) : return ( [ ] , [ ] , [ ] ) elif ( not f ) : return ( dup_monic ( g , K ) , [ ] , [ dup_LC ( g , K ) ] ) elif ( not g ) : return ( dup_monic ( f , K ) , [ dup_LC ( f , K ) ] , [ ] ) else : return None
handle trivial cases in gcd algorithm over a field .