On dividing 3x3+4x2+5x−13 by a polynomial g(x), the quotient and remainder were 3x+10 and 16x−43 respectively. Find the polynomial g(x).