We perform a synthetic division
#color(white)(aaaa)##3##color(white)(aaaa)##|##color(white)(aaaa)##1##color(white)(aaaa)##-13##color(white)(aaaaaaa)##24##color(white)(aaaaaa)##18##color(white)(aaaaaa)###
#color(white)(aaaaaa)##color(white)(aaa)##|##color(white)(aaa)##color(white)(aaaaaaaaa)##3##color(white)(aaaaa)##-30##color(white)(aaaa)##-18##color(white)(aaaaaa)###
#color(white)(aaaaaaaaaa)#------------------------------------------------------------
#color(white)(aaaa)color(white)(aaaaaa)color(white)(aaaaaa)1color(white)(aaaa)-10##color(white)(aaaaa)-6color(white)(aaaaa)color(white)(aa)color(red)(0)#
The remainder is #=0#
The quotient is #=m^2-10m-6#