A New Hybrid N-body-coagulation Code for the Formation of Gas Giant Planets