Perfect splitting of a two-photon pulse