How do you apply the pythagorean theorem in word problems?