Measurement of differential cross sections of Z boson pair production in association with jets at sqrt(s) = 8 and 13 TeV