def gf_lcm(f, g, p, K):
 if ((not f) or (not g)):
  return []
 h = gf_quo(gf_mul(f, g, p, K), gf_gcd(f, g, p, K), p, K)
 return gf_monic(h, p, K)[1]

def gf_lcm ( f , g , p , K ) : if ( ( not f ) or ( not g ) ) : return [ ] h = gf_quo ( gf_mul ( f , g , p , K ) , gf_gcd ( f , g , p , K ) , p , K ) return gf_monic ( h , p , K ) [ 1 ]
compute polynomial lcm in gf(p)[x] .