a = 
      Expand[(x - 3  y + (x^3)) (2  x + 45  (y^2) - x y)]

a /. y -> 1

res1 = Factor[a /. y -> 1]

wert[1] = res1[[1]]

a /. y -> 2

res2 = Factor[a /. y -> 2]

wert[2] = res2[[2]]

b = 
      Expand[InterpolatingPolynomial[{{1, wert[1]}, {2, wert[2]}}, 
          y]]

Together[PolynomialRemainder[a, b, y]]

wert[1] = res1[[2]]

b = 
      Expand[InterpolatingPolynomial[{{1, wert[1]}, {2, wert[2]}}, 
          y]]

Together[PolynomialRemainder[a, b, y]]

PolynomialQuotient[a, b, y]

Factor[a]

a /. x -> 1

res1 = Factor[a /. x -> 1]

wert[1] = res1[[3]]

a /. x -> 2

res2 = Factor[a /. x -> 2]

wert[2] = res2[[3]]

a /. x -> 3

res3 = Factor[a /. x -> 3]

wert[3] = 3 res3[[3]]

b = 
      Expand[InterpolatingPolynomial[{{1, wert[1]}, {2, wert[2]}, {3, 
              wert[3]}}, x]]

Together[PolynomialRemainder[a, b, x]]

Together[PolynomialQuotient[a, b, x]]