(x+a)2=x2+2ax+a2 for a perfect square. So 2ax=24x, making a=12, a2=144.
x2+24x+144 is one solution, equivalent to (x+12)2.
(x+a)(x+b)=x2+(a+b)x+ab.
If a+b=24, then b=24-a and a can take any value. If ab is positive then 0<a<24.
For example, if a=10 then b=14 and we have x2+24x+140=(x+10)(x+14);
if a=5, b=19 and we have x2+24x+95=(x+5)(x+19).
etc.