Step 1 — dimensions of the base. Cutting a square of side x from each end of a side removes 2x from it:
length=(30−2x) cm,breadth=(20−2x) cm
Step 2 — form the equation.
(30−2x)(20−2x)=336
600−100x+4x2=336⇒4x2−100x+264=0⇒x2−25x+66=0
Step 3 — factorise. Two numbers with product 66 and sum −25: −3 and −22.
(x−3)(x−22)=0⇒x=3 or x=22
Step 4 — reject the impossible root. If x=22, the breadth would be 20−44=−24 cm, which is impossible (we cannot even cut two 22 cm squares from a 20 cm side). So x=3.
Check: base =24 cm×14 cm=336 cm2 ✓.
Answer: x=3 cm.