Search for resonant and nonresonant production of pairs of dijet resonances in proton-proton collisions at √ = 13 TeV