Evil math problem

Thanks, Johnny L.A. And yeah, it turns out that 6^2 + 5^2 + 12 was the way to go.