Search for resonances and quantum black holes using dijet mass spectra in proton-proton collisions ats=8  TeV