Simultaneous identification of piecewise constant sound speed and initial data for the photoacoustic tomography problem