Where this goes wrong
q = m · c · ΔT
250 g water · c = 4.184 J/g·°C · 20.0 → 50.0 °C · correct q = 31,400 J
Leaving out the mass. 4.184 × 30.0 = 126 J is the heat for a single gram. The sample has 250 of them. All three factors multiply: q = m·c·ΔT = 31,400 J.
Leaving out the temperature change. 250 × 4.184 = 1046 J warms the water by one degree only. Multiply by the full ΔT of 30.0 °C.
Dividing by the specific heat. 250 × 30.0 ÷ 4.184 = 1790, and its units are g²·°C²/J, not joules. c multiplies on top: (4.184 J / 1 g·°C).
Subtracting the temperatures in the wrong order. ΔT = 20.0 − 50.0 = −30.0 °C gives q = −31,400 J: heat released by water that is warming. ΔT is Tfinal − Tinitial.