Searches for light- and heavy-flavour three-jet resonances in pp collisions at root s=8 TeV